diff --git a/clutter/cogl/cogl/cogl-debug-options.h b/clutter/cogl/cogl/cogl-debug-options.h index 972c69cfe..578568353 100644 --- a/clutter/cogl/cogl/cogl-debug-options.h +++ b/clutter/cogl/cogl/cogl-debug-options.h @@ -168,4 +168,9 @@ OPT (DISABLE_BLENDING, "disable-program-caches", "Disable program caches", "Disable fallback caches for arbfp and glsl programs") - +OPT (DISABLE_FAST_READ_PIXEL, + "Root Cause", + "disable-fast-read-pixel", + "Disable read pixel optimization", + "Disable optimization for reading 1px for simple " + "scenes of opaque rectangles") diff --git a/clutter/cogl/cogl/cogl-debug.c b/clutter/cogl/cogl/cogl-debug.c index 5c2b5c2fe..77e43bf19 100644 --- a/clutter/cogl/cogl/cogl-debug.c +++ b/clutter/cogl/cogl/cogl-debug.c @@ -75,7 +75,8 @@ static const GDebugKey cogl_behavioural_debug_keys[] = { { "disable-npot-textures", COGL_DEBUG_DISABLE_NPOT_TEXTURES}, { "wireframe", COGL_DEBUG_WIREFRAME}, { "disable-software-clip", COGL_DEBUG_DISABLE_SOFTWARE_CLIP}, - { "disable-program-caches", COGL_DEBUG_DISABLE_PROGRAM_CACHES} + { "disable-program-caches", COGL_DEBUG_DISABLE_PROGRAM_CACHES}, + { "disable-fast-read-pixel", COGL_DEBUG_DISABLE_FAST_READ_PIXEL} }; static const int n_cogl_behavioural_debug_keys = G_N_ELEMENTS (cogl_behavioural_debug_keys); diff --git a/clutter/cogl/cogl/cogl-debug.h b/clutter/cogl/cogl/cogl-debug.h index 1a06bf734..51155edd8 100644 --- a/clutter/cogl/cogl/cogl-debug.h +++ b/clutter/cogl/cogl/cogl-debug.h @@ -31,36 +31,37 @@ G_BEGIN_DECLS typedef enum { - COGL_DEBUG_SLICING = 1 << 1, - COGL_DEBUG_OFFSCREEN = 1 << 2, - COGL_DEBUG_DRAW = 1 << 3, - COGL_DEBUG_PANGO = 1 << 4, - COGL_DEBUG_RECTANGLES = 1 << 5, - COGL_DEBUG_HANDLE = 1 << 6, - COGL_DEBUG_BLEND_STRINGS = 1 << 7, - COGL_DEBUG_DISABLE_BATCHING = 1 << 8, - COGL_DEBUG_DISABLE_VBOS = 1 << 9, - COGL_DEBUG_DISABLE_PBOS = 1 << 10, - COGL_DEBUG_JOURNAL = 1 << 11, - COGL_DEBUG_BATCHING = 1 << 12, - COGL_DEBUG_DISABLE_SOFTWARE_TRANSFORM = 1 << 13, - COGL_DEBUG_MATRICES = 1 << 14, - COGL_DEBUG_ATLAS = 1 << 15, - COGL_DEBUG_DUMP_ATLAS_IMAGE = 1 << 16, - COGL_DEBUG_DISABLE_ATLAS = 1 << 17, - COGL_DEBUG_OPENGL = 1 << 18, - COGL_DEBUG_DISABLE_TEXTURING = 1 << 19, - COGL_DEBUG_DISABLE_ARBFP = 1 << 20, - COGL_DEBUG_DISABLE_FIXED = 1 << 21, - COGL_DEBUG_DISABLE_GLSL = 1 << 22, - COGL_DEBUG_SHOW_SOURCE = 1 << 23, - COGL_DEBUG_DISABLE_BLENDING = 1 << 24, - COGL_DEBUG_TEXTURE_PIXMAP = 1 << 25, - COGL_DEBUG_BITMAP = 1 << 26, - COGL_DEBUG_DISABLE_NPOT_TEXTURES = 1 << 27, - COGL_DEBUG_WIREFRAME = 1 << 28, - COGL_DEBUG_DISABLE_SOFTWARE_CLIP = 1 << 29, - COGL_DEBUG_DISABLE_PROGRAM_CACHES = 1 << 30 + COGL_DEBUG_SLICING = 1 << 0, + COGL_DEBUG_OFFSCREEN = 1 << 1, + COGL_DEBUG_DRAW = 1 << 2, + COGL_DEBUG_PANGO = 1 << 3, + COGL_DEBUG_RECTANGLES = 1 << 4, + COGL_DEBUG_HANDLE = 1 << 5, + COGL_DEBUG_BLEND_STRINGS = 1 << 6, + COGL_DEBUG_DISABLE_BATCHING = 1 << 7, + COGL_DEBUG_DISABLE_VBOS = 1 << 8, + COGL_DEBUG_DISABLE_PBOS = 1 << 9, + COGL_DEBUG_JOURNAL = 1 << 10, + COGL_DEBUG_BATCHING = 1 << 11, + COGL_DEBUG_DISABLE_SOFTWARE_TRANSFORM = 1 << 12, + COGL_DEBUG_MATRICES = 1 << 13, + COGL_DEBUG_ATLAS = 1 << 14, + COGL_DEBUG_DUMP_ATLAS_IMAGE = 1 << 15, + COGL_DEBUG_DISABLE_ATLAS = 1 << 16, + COGL_DEBUG_OPENGL = 1 << 17, + COGL_DEBUG_DISABLE_TEXTURING = 1 << 18, + COGL_DEBUG_DISABLE_ARBFP = 1 << 19, + COGL_DEBUG_DISABLE_FIXED = 1 << 20, + COGL_DEBUG_DISABLE_GLSL = 1 << 21, + COGL_DEBUG_SHOW_SOURCE = 1 << 22, + COGL_DEBUG_DISABLE_BLENDING = 1 << 23, + COGL_DEBUG_TEXTURE_PIXMAP = 1 << 24, + COGL_DEBUG_BITMAP = 1 << 25, + COGL_DEBUG_DISABLE_NPOT_TEXTURES = 1 << 26, + COGL_DEBUG_WIREFRAME = 1 << 27, + COGL_DEBUG_DISABLE_SOFTWARE_CLIP = 1 << 28, + COGL_DEBUG_DISABLE_PROGRAM_CACHES = 1 << 29, + COGL_DEBUG_DISABLE_FAST_READ_PIXEL = 1 << 30 } CoglDebugFlags; #ifdef COGL_ENABLE_DEBUG diff --git a/clutter/cogl/cogl/cogl-framebuffer.c b/clutter/cogl/cogl/cogl-framebuffer.c index 1519d58f3..1a63cda84 100644 --- a/clutter/cogl/cogl/cogl-framebuffer.c +++ b/clutter/cogl/cogl/cogl-framebuffer.c @@ -1237,6 +1237,9 @@ _cogl_framebuffer_try_fast_read_pixel (CoglFramebuffer *framebuffer, { gboolean found_intersection; + if (G_UNLIKELY (cogl_debug_flags & COGL_DEBUG_DISABLE_FAST_READ_PIXEL)) + return FALSE; + if (source != COGL_READ_PIXELS_COLOR_BUFFER) return FALSE; diff --git a/clutter/cogl/cogl/cogl-journal.c b/clutter/cogl/cogl/cogl-journal.c index f0e8f3896..e9f3a4cef 100644 --- a/clutter/cogl/cogl/cogl-journal.c +++ b/clutter/cogl/cogl/cogl-journal.c @@ -1689,6 +1689,9 @@ try_checking_point_hits_entry_after_clipping (CoglJournalEntry *entry, ClipBounds clip_bounds; float poly[16]; + if (!can_software_clip) + return FALSE; + if (!can_software_clip_entry (entry, NULL, entry->clip_stack, &clip_bounds)) return FALSE;