mirror of
https://github.com/brl/mutter.git
synced 2025-05-30 10:30:03 +00:00
cogl/offscreen: Move struct to C file
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1514>
This commit is contained in:
parent
ece714c5c6
commit
58eb1e87bf
@ -1636,8 +1636,9 @@ _cogl_journal_log_quad (CoglJournal *journal,
|
|||||||
if (COGL_IS_OFFSCREEN (framebuffer))
|
if (COGL_IS_OFFSCREEN (framebuffer))
|
||||||
{
|
{
|
||||||
CoglOffscreen *offscreen = COGL_OFFSCREEN (framebuffer);
|
CoglOffscreen *offscreen = COGL_OFFSCREEN (framebuffer);
|
||||||
|
CoglTexture *texture = cogl_offscreen_get_texture (offscreen);
|
||||||
|
|
||||||
_cogl_texture_2d_externally_modified (offscreen->texture);
|
_cogl_texture_2d_externally_modified (texture);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (G_UNLIKELY (COGL_DEBUG_ENABLED (COGL_DEBUG_SYNC_PRIMITIVE)))
|
if (G_UNLIKELY (COGL_DEBUG_ENABLED (COGL_DEBUG_SYNC_PRIMITIVE)))
|
||||||
|
@ -44,19 +44,6 @@ typedef enum
|
|||||||
COGL_OFFSCREEN_ALLOCATE_FLAG_STENCIL = 1 << 2,
|
COGL_OFFSCREEN_ALLOCATE_FLAG_STENCIL = 1 << 2,
|
||||||
} CoglOffscreenAllocateFlags;
|
} CoglOffscreenAllocateFlags;
|
||||||
|
|
||||||
struct _CoglOffscreen
|
|
||||||
{
|
|
||||||
CoglFramebuffer parent;
|
|
||||||
|
|
||||||
CoglTexture *texture;
|
|
||||||
int texture_level;
|
|
||||||
|
|
||||||
/* FIXME: _cogl_offscreen_new_with_texture_full should be made to use
|
|
||||||
* fb->config to configure if we want a depth or stencil buffer so
|
|
||||||
* we can get rid of these flags */
|
|
||||||
CoglOffscreenFlags create_flags;
|
|
||||||
};
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* _cogl_offscreen_new_with_texture_full:
|
* _cogl_offscreen_new_with_texture_full:
|
||||||
* @texture: A #CoglTexture pointer
|
* @texture: A #CoglTexture pointer
|
||||||
@ -75,4 +62,7 @@ _cogl_offscreen_new_with_texture_full (CoglTexture *texture,
|
|||||||
CoglOffscreenFlags create_flags,
|
CoglOffscreenFlags create_flags,
|
||||||
int level);
|
int level);
|
||||||
|
|
||||||
|
int
|
||||||
|
cogl_offscreen_get_texture_level (CoglOffscreen *offscreen);
|
||||||
|
|
||||||
#endif /* COGL_OFFSCREEN_PRIVATE_H */
|
#endif /* COGL_OFFSCREEN_PRIVATE_H */
|
||||||
|
@ -32,6 +32,19 @@
|
|||||||
#include "cogl-offscreen-private.h"
|
#include "cogl-offscreen-private.h"
|
||||||
#include "cogl-texture-private.h"
|
#include "cogl-texture-private.h"
|
||||||
|
|
||||||
|
struct _CoglOffscreen
|
||||||
|
{
|
||||||
|
CoglFramebuffer parent;
|
||||||
|
|
||||||
|
CoglTexture *texture;
|
||||||
|
int texture_level;
|
||||||
|
|
||||||
|
/* FIXME: _cogl_offscreen_new_with_texture_full should be made to use
|
||||||
|
* fb->config to configure if we want a depth or stencil buffer so
|
||||||
|
* we can get rid of these flags */
|
||||||
|
CoglOffscreenFlags create_flags;
|
||||||
|
};
|
||||||
|
|
||||||
G_DEFINE_TYPE (CoglOffscreen, cogl_offscreen,
|
G_DEFINE_TYPE (CoglOffscreen, cogl_offscreen,
|
||||||
COGL_TYPE_FRAMEBUFFER)
|
COGL_TYPE_FRAMEBUFFER)
|
||||||
|
|
||||||
@ -77,6 +90,12 @@ cogl_offscreen_get_texture (CoglOffscreen *offscreen)
|
|||||||
return offscreen->texture;
|
return offscreen->texture;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
cogl_offscreen_get_texture_level (CoglOffscreen *offscreen)
|
||||||
|
{
|
||||||
|
return offscreen->texture_level;
|
||||||
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
cogl_offscreen_allocate (CoglFramebuffer *framebuffer,
|
cogl_offscreen_allocate (CoglFramebuffer *framebuffer,
|
||||||
GError **error)
|
GError **error)
|
||||||
|
@ -645,15 +645,19 @@ _cogl_offscreen_gl_allocate (CoglOffscreen *offscreen,
|
|||||||
CoglGlFramebufferPrivate *priv;
|
CoglGlFramebufferPrivate *priv;
|
||||||
CoglGlFbo *gl_fbo;
|
CoglGlFbo *gl_fbo;
|
||||||
const CoglFramebufferConfig *config;
|
const CoglFramebufferConfig *config;
|
||||||
|
CoglTexture *texture;
|
||||||
|
int texture_level;
|
||||||
int level_width;
|
int level_width;
|
||||||
int level_height;
|
int level_height;
|
||||||
|
|
||||||
g_return_val_if_fail (offscreen->texture_level <
|
texture = cogl_offscreen_get_texture (offscreen);
|
||||||
_cogl_texture_get_n_levels (offscreen->texture),
|
texture_level = cogl_offscreen_get_texture_level (offscreen);
|
||||||
|
|
||||||
|
g_return_val_if_fail (texture_level < _cogl_texture_get_n_levels (texture),
|
||||||
FALSE);
|
FALSE);
|
||||||
|
|
||||||
_cogl_texture_get_level_size (offscreen->texture,
|
_cogl_texture_get_level_size (texture,
|
||||||
offscreen->texture_level,
|
texture_level,
|
||||||
&level_width,
|
&level_width,
|
||||||
&level_height,
|
&level_height,
|
||||||
NULL);
|
NULL);
|
||||||
@ -668,7 +672,7 @@ _cogl_offscreen_gl_allocate (CoglOffscreen *offscreen,
|
|||||||
* the texture is actually used for rendering according to the filters set on
|
* the texture is actually used for rendering according to the filters set on
|
||||||
* the corresponding CoglPipeline.
|
* the corresponding CoglPipeline.
|
||||||
*/
|
*/
|
||||||
_cogl_texture_gl_flush_legacy_texobj_filters (offscreen->texture,
|
_cogl_texture_gl_flush_legacy_texobj_filters (texture,
|
||||||
GL_NEAREST, GL_NEAREST);
|
GL_NEAREST, GL_NEAREST);
|
||||||
|
|
||||||
config = cogl_framebuffer_get_config (framebuffer);
|
config = cogl_framebuffer_get_config (framebuffer);
|
||||||
@ -679,8 +683,8 @@ _cogl_offscreen_gl_allocate (CoglOffscreen *offscreen,
|
|||||||
|
|
||||||
if (((flags & COGL_OFFSCREEN_DISABLE_DEPTH_AND_STENCIL) &&
|
if (((flags & COGL_OFFSCREEN_DISABLE_DEPTH_AND_STENCIL) &&
|
||||||
try_creating_fbo (ctx,
|
try_creating_fbo (ctx,
|
||||||
offscreen->texture,
|
texture,
|
||||||
offscreen->texture_level,
|
texture_level,
|
||||||
level_width,
|
level_width,
|
||||||
level_height,
|
level_height,
|
||||||
config,
|
config,
|
||||||
@ -689,8 +693,8 @@ _cogl_offscreen_gl_allocate (CoglOffscreen *offscreen,
|
|||||||
|
|
||||||
(ctx->have_last_offscreen_allocate_flags &&
|
(ctx->have_last_offscreen_allocate_flags &&
|
||||||
try_creating_fbo (ctx,
|
try_creating_fbo (ctx,
|
||||||
offscreen->texture,
|
texture,
|
||||||
offscreen->texture_level,
|
texture_level,
|
||||||
level_width,
|
level_width,
|
||||||
level_height,
|
level_height,
|
||||||
config,
|
config,
|
||||||
@ -705,8 +709,8 @@ _cogl_offscreen_gl_allocate (CoglOffscreen *offscreen,
|
|||||||
_cogl_has_private_feature
|
_cogl_has_private_feature
|
||||||
(ctx, COGL_PRIVATE_FEATURE_OES_PACKED_DEPTH_STENCIL)) &&
|
(ctx, COGL_PRIVATE_FEATURE_OES_PACKED_DEPTH_STENCIL)) &&
|
||||||
try_creating_fbo (ctx,
|
try_creating_fbo (ctx,
|
||||||
offscreen->texture,
|
texture,
|
||||||
offscreen->texture_level,
|
texture_level,
|
||||||
level_width,
|
level_width,
|
||||||
level_height,
|
level_height,
|
||||||
config,
|
config,
|
||||||
@ -714,8 +718,8 @@ _cogl_offscreen_gl_allocate (CoglOffscreen *offscreen,
|
|||||||
gl_fbo)) ||
|
gl_fbo)) ||
|
||||||
|
|
||||||
try_creating_fbo (ctx,
|
try_creating_fbo (ctx,
|
||||||
offscreen->texture,
|
texture,
|
||||||
offscreen->texture_level,
|
texture_level,
|
||||||
level_width,
|
level_width,
|
||||||
level_height,
|
level_height,
|
||||||
config,
|
config,
|
||||||
@ -724,8 +728,8 @@ _cogl_offscreen_gl_allocate (CoglOffscreen *offscreen,
|
|||||||
gl_fbo) ||
|
gl_fbo) ||
|
||||||
|
|
||||||
try_creating_fbo (ctx,
|
try_creating_fbo (ctx,
|
||||||
offscreen->texture,
|
texture,
|
||||||
offscreen->texture_level,
|
texture_level,
|
||||||
level_width,
|
level_width,
|
||||||
level_height,
|
level_height,
|
||||||
config,
|
config,
|
||||||
@ -733,8 +737,8 @@ _cogl_offscreen_gl_allocate (CoglOffscreen *offscreen,
|
|||||||
gl_fbo) ||
|
gl_fbo) ||
|
||||||
|
|
||||||
try_creating_fbo (ctx,
|
try_creating_fbo (ctx,
|
||||||
offscreen->texture,
|
texture,
|
||||||
offscreen->texture_level,
|
texture_level,
|
||||||
level_width,
|
level_width,
|
||||||
level_height,
|
level_height,
|
||||||
config,
|
config,
|
||||||
@ -742,8 +746,8 @@ _cogl_offscreen_gl_allocate (CoglOffscreen *offscreen,
|
|||||||
gl_fbo) ||
|
gl_fbo) ||
|
||||||
|
|
||||||
try_creating_fbo (ctx,
|
try_creating_fbo (ctx,
|
||||||
offscreen->texture,
|
texture,
|
||||||
offscreen->texture_level,
|
texture_level,
|
||||||
level_width,
|
level_width,
|
||||||
level_height,
|
level_height,
|
||||||
config,
|
config,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user