diff --git a/clutter/clutter/clutter-stage-view.c b/clutter/clutter/clutter-stage-view.c index 63e24104d..12cb317f9 100644 --- a/clutter/clutter/clutter-stage-view.c +++ b/clutter/clutter/clutter-stage-view.c @@ -192,7 +192,7 @@ create_offscreen (ClutterStageView *view, width, height, format); } - cogl_texture_set_auto_mipmap (texture, FALSE); + cogl_texture_2d_set_auto_mipmap (COGL_TEXTURE_2D (texture), FALSE); if (!cogl_texture_allocate (texture, error)) return FALSE; diff --git a/cogl/cogl/cogl-texture-2d-private.h b/cogl/cogl/cogl-texture-2d-private.h index 3cc3b5d67..d1ab5b87f 100644 --- a/cogl/cogl/cogl-texture-2d-private.h +++ b/cogl/cogl/cogl-texture-2d-private.h @@ -77,10 +77,6 @@ _cogl_texture_2d_create_base (CoglContext *ctx, CoglPixelFormat internal_format, CoglTextureLoader *loader); -void -_cogl_texture_2d_set_auto_mipmap (CoglTexture *tex, - gboolean value); - /* * _cogl_texture_2d_externally_modified: * @texture: A #CoglTexture2D object diff --git a/cogl/cogl/cogl-texture-2d.c b/cogl/cogl/cogl-texture-2d.c index 983fb1c83..c58b702f1 100644 --- a/cogl/cogl/cogl-texture-2d.c +++ b/cogl/cogl/cogl-texture-2d.c @@ -66,12 +66,10 @@ cogl_texture_2d_dispose (GObject *object) } void -_cogl_texture_2d_set_auto_mipmap (CoglTexture *tex, - gboolean value) +cogl_texture_2d_set_auto_mipmap (CoglTexture2D *tex, + gboolean value) { - CoglTexture2D *tex_2d = COGL_TEXTURE_2D (tex); - - tex_2d->auto_mipmap = value; + tex->auto_mipmap = value; } CoglTexture * @@ -87,7 +85,6 @@ _cogl_texture_2d_create_base (CoglContext *ctx, "height", height, "loader", loader, "format", internal_format, - "is-primitive", TRUE, NULL); CoglTextureDriverClass *tex_driver = COGL_TEXTURE_DRIVER_GET_CLASS (ctx->texture_driver); @@ -355,7 +352,6 @@ cogl_texture_2d_class_init (CoglTexture2DClass *klass) texture_class->gl_flush_legacy_texobj_wrap_modes = _cogl_texture_2d_gl_flush_legacy_texobj_wrap_modes; texture_class->get_format = _cogl_texture_2d_get_format; texture_class->get_gl_format = _cogl_texture_2d_get_gl_format; - texture_class->set_auto_mipmap = _cogl_texture_2d_set_auto_mipmap; } static void diff --git a/cogl/cogl/cogl-texture-2d.h b/cogl/cogl/cogl-texture-2d.h index 4a0361b33..bf4a80dce 100644 --- a/cogl/cogl/cogl-texture-2d.h +++ b/cogl/cogl/cogl-texture-2d.h @@ -229,4 +229,20 @@ cogl_texture_2d_new_from_egl_image_external (CoglContext *ctx, #endif +/** + * cogl_texture_2d_set_auto_mipmap: + * @texture: A #CoglTexture2D + * @value: The new value for whether to auto mipmap + * + * Sets whether the texture will automatically update the smaller + * mipmap levels after any part of level 0 is updated. The update will + * only occur whenever the texture is used for drawing with a texture + * filter that requires the lower mipmap levels. An application should + * disable this if it wants to upload its own data for the other + * levels. By default auto mipmapping is enabled. + */ +COGL_EXPORT void +cogl_texture_2d_set_auto_mipmap (CoglTexture2D *texture, + gboolean value); + G_END_DECLS diff --git a/cogl/cogl/cogl-texture-private.h b/cogl/cogl/cogl-texture-private.h index 5cffd9b0b..ad79bf37d 100644 --- a/cogl/cogl/cogl-texture-private.h +++ b/cogl/cogl/cogl-texture-private.h @@ -182,10 +182,6 @@ struct _CoglTextureClass CoglPixelFormat (* get_format) (CoglTexture *tex); GLenum (* get_gl_format) (CoglTexture *tex); - - /* Only needs to be implemented if is_primitive == TRUE */ - void (* set_auto_mipmap) (CoglTexture *texture, - gboolean value); }; gboolean diff --git a/cogl/cogl/cogl-texture.c b/cogl/cogl/cogl-texture.c index 6d6123aba..0b9f56ab3 100644 --- a/cogl/cogl/cogl-texture.c +++ b/cogl/cogl/cogl-texture.c @@ -63,7 +63,6 @@ typedef struct _CoglTexturePrivate { CoglContext *context; - gboolean is_primitive; CoglTextureLoader *loader; GList *framebuffers; int max_level_set; @@ -90,7 +89,6 @@ enum PROP_HEIGHT, PROP_LOADER, PROP_FORMAT, - PROP_IS_PRIMITIVE, PROP_LAST }; @@ -177,10 +175,6 @@ cogl_texture_set_property (GObject *gobject, priv->premultiplied = TRUE; break; - case PROP_IS_PRIMITIVE: - priv->is_primitive = g_value_get_boolean (value); - break; - default: G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec); break; @@ -222,10 +216,6 @@ cogl_texture_class_init (CoglTextureClass *klass) COGL_PIXEL_FORMAT_ANY, G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); - obj_props[PROP_IS_PRIMITIVE] = - g_param_spec_boolean ("is-primitive", NULL, NULL, - FALSE, G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | - G_PARAM_STATIC_STRINGS); g_object_class_install_properties (gobject_class, PROP_LAST, @@ -1385,17 +1375,3 @@ cogl_texture_set_max_level_set (CoglTexture *texture, cogl_texture_get_instance_private (texture); priv->max_level_set = max_level_set; } - -void -cogl_texture_set_auto_mipmap (CoglTexture *texture, - gboolean value) -{ - CoglTexturePrivate *priv; - g_return_if_fail (COGL_IS_TEXTURE (texture)); - priv = cogl_texture_get_instance_private (texture); - g_return_if_fail (priv->is_primitive); - - g_assert (COGL_TEXTURE_GET_CLASS (texture)->set_auto_mipmap != NULL); - - COGL_TEXTURE_GET_CLASS (texture)->set_auto_mipmap (texture, value); -} diff --git a/cogl/cogl/cogl-texture.h b/cogl/cogl/cogl-texture.h index 2ca2118d1..992dad8e8 100644 --- a/cogl/cogl/cogl-texture.h +++ b/cogl/cogl/cogl-texture.h @@ -449,22 +449,6 @@ cogl_texture_allocate (CoglTexture *texture, COGL_EXPORT gboolean cogl_texture_is_get_data_supported (CoglTexture *texture); -/** - * cogl_texture_set_auto_mipmap: - * @texture: A #CoglTexture - * @value: The new value for whether to auto mipmap - * - * Sets whether the texture will automatically update the smaller - * mipmap levels after any part of level 0 is updated. The update will - * only occur whenever the texture is used for drawing with a texture - * filter that requires the lower mipmap levels. An application should - * disable this if it wants to upload its own data for the other - * levels. By default auto mipmapping is enabled. - */ -COGL_EXPORT void -cogl_texture_set_auto_mipmap (CoglTexture *texture, - gboolean value); - COGL_EXPORT CoglPixelFormat cogl_texture_get_format (CoglTexture *texture); diff --git a/src/backends/meta-screen-cast-stream-src.c b/src/backends/meta-screen-cast-stream-src.c index ccc571f27..581b4db5e 100644 --- a/src/backends/meta-screen-cast-stream-src.c +++ b/src/backends/meta-screen-cast-stream-src.c @@ -388,7 +388,7 @@ draw_cursor_sprite_via_offscreen (MetaScreenCastStreamSrc *src, bitmap_texture = cogl_texture_2d_new_with_size (cogl_context, bitmap_width, bitmap_height); - cogl_texture_set_auto_mipmap (bitmap_texture, FALSE); + cogl_texture_2d_set_auto_mipmap (COGL_TEXTURE_2D (bitmap_texture), FALSE); if (!cogl_texture_allocate (bitmap_texture, error)) { g_object_unref (bitmap_texture); diff --git a/src/backends/native/meta-renderer-native.c b/src/backends/native/meta-renderer-native.c index b6d55a13d..6a421b01f 100644 --- a/src/backends/native/meta-renderer-native.c +++ b/src/backends/native/meta-renderer-native.c @@ -1300,7 +1300,7 @@ meta_renderer_native_create_offscreen (MetaRendererNative *renderer_native, view_width, view_height, format); } - cogl_texture_set_auto_mipmap (tex, FALSE); + cogl_texture_2d_set_auto_mipmap (COGL_TEXTURE_2D (tex), FALSE); if (!cogl_texture_allocate (tex, error)) { diff --git a/src/compositor/meta-window-actor.c b/src/compositor/meta-window-actor.c index e2c23c957..923f9bdd9 100644 --- a/src/compositor/meta-window-actor.c +++ b/src/compositor/meta-window-actor.c @@ -1585,7 +1585,7 @@ create_framebuffer_from_window_actor (MetaWindowActor *self, if (!texture) return NULL; - cogl_texture_set_auto_mipmap (texture, FALSE); + cogl_texture_2d_set_auto_mipmap (COGL_TEXTURE_2D (texture), FALSE); offscreen = cogl_offscreen_new_with_texture (texture); framebuffer = COGL_FRAMEBUFFER (offscreen); diff --git a/src/tests/cogl-test-utils.c b/src/tests/cogl-test-utils.c index 8910290c5..6749688ec 100644 --- a/src/tests/cogl-test-utils.c +++ b/src/tests/cogl-test-utils.c @@ -193,7 +193,7 @@ set_auto_mipmap_cb (CoglTexture *sub_texture, const float *meta_coords, void *user_data) { - cogl_texture_set_auto_mipmap (sub_texture, FALSE); + cogl_texture_2d_set_auto_mipmap (COGL_TEXTURE_2D (sub_texture), FALSE); } CoglTexture *