Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1605)

Unified Diff: content/renderer/media/renderer_gpu_video_accelerator_factories.cc

Issue 31583004: Enable glReadPixels from <video> to 2d context on Android. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Re-enable SkCanvasVideoRendererTest.* Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/android/pylib/gtest/filter/media_unittests_disabled ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/renderer_gpu_video_accelerator_factories.cc
diff --git a/content/renderer/media/renderer_gpu_video_accelerator_factories.cc b/content/renderer/media/renderer_gpu_video_accelerator_factories.cc
index 86d40cd960b67deb86d3dc954cd3c8d96bb6a687..7b4777c03451e87d2fe4d9611508b8f16a8239c1 100644
--- a/content/renderer/media/renderer_gpu_video_accelerator_factories.cc
+++ b/content/renderer/media/renderer_gpu_video_accelerator_factories.cc
@@ -257,11 +257,20 @@ void RendererGpuVideoAcceleratorFactories::AsyncReadPixels(
gles2->FramebufferTexture2D(
GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, tmp_texture, 0);
gles2->PixelStorei(GL_PACK_ALIGNMENT, 4);
+#if SK_B32_SHIFT == 0 && SK_G32_SHIFT == 8 && SK_R32_SHIFT == 16 && \
scherkus (not reviewing) 2013/10/22 18:29:10 it seems like the cool kids only check for SK_B32_
scherkus (not reviewing) 2013/10/22 18:29:46 ... there really isn't a reason *NOT* to check ...
Ami GONE FROM CHROMIUM 2013/10/22 18:32:59 Yeah, the first version of this code was actually
+ SK_A32_SHIFT == 24
+ GLenum skia_format = GL_BGRA_EXT;
+#elif SK_R32_SHIFT == 0 && SK_G32_SHIFT == 8 && SK_B32_SHIFT == 16 && \
+ SK_A32_SHIFT == 24
+ GLenum skia_format = GL_RGBA;
+#else
+#error Unexpected Skia ARGB_8888 layout!
+#endif
gles2->ReadPixels(0,
0,
size.width(),
size.height(),
- GL_BGRA_EXT,
+ skia_format,
GL_UNSIGNED_BYTE,
read_pixels_bitmap_.pixelRef()->pixels());
gles2->DeleteFramebuffers(1, &fb);
« no previous file with comments | « build/android/pylib/gtest/filter/media_unittests_disabled ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698