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

Unified Diff: gpu/command_buffer/client/gles2_implementation.cc

Issue 1513283002: Add support to send optimal format as part of ScheduleOverlayPlane (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update cmd_buffer_functions Created 5 years 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
Index: gpu/command_buffer/client/gles2_implementation.cc
diff --git a/gpu/command_buffer/client/gles2_implementation.cc b/gpu/command_buffer/client/gles2_implementation.cc
index 587a5db07d5513758a194ac285f3bd7f0a1d1620..8b42e966f46526e85cce169cb49781bd94d66d21 100644
--- a/gpu/command_buffer/client/gles2_implementation.cc
+++ b/gpu/command_buffer/client/gles2_implementation.cc
@@ -4415,14 +4415,31 @@ static GLenum GetGLESOverlayTransform(gfx::OverlayTransform plane_transform) {
return GL_OVERLAY_TRANSFORM_NONE_CHROMIUM;
}
+static GLuint GetGLESOverlayFormat(gfx::BufferFormat storage_format) {
+ switch (storage_format) {
+ case gfx::BufferFormat::BGRX_8888:
+ return GL_BGR;
+ case gfx::BufferFormat::BGRA_8888:
+ return GL_BGRA_EXT;
+ case gfx::BufferFormat::UYVY_422:
+ return GL_RGB_YCBCR_422_CHROMIUM;
+ default:
+ NOTREACHED();
+ return GL_BGRA_EXT;
+ }
+}
+
void GLES2Implementation::ScheduleOverlayPlane(
int plane_z_order,
gfx::OverlayTransform plane_transform,
+ gfx::BufferFormat optimal_storage_format,
unsigned overlay_texture_id,
const gfx::Rect& display_bounds,
- const gfx::RectF& uv_rect) {
+ const gfx::RectF& uv_rect,
+ bool handle_scaling) {
ScheduleOverlayPlaneCHROMIUM(plane_z_order,
GetGLESOverlayTransform(plane_transform),
+ GetGLESOverlayFormat(optimal_storage_format),
overlay_texture_id,
display_bounds.x(),
display_bounds.y(),
@@ -4431,7 +4448,8 @@ void GLES2Implementation::ScheduleOverlayPlane(
uv_rect.x(),
uv_rect.y(),
uv_rect.width(),
- uv_rect.height());
+ uv_rect.height(),
+ handle_scaling);
}
void GLES2Implementation::ScheduleCALayerCHROMIUM(GLuint contents_texture_id,
« no previous file with comments | « gpu/command_buffer/client/gles2_implementation.h ('k') | gpu/command_buffer/client/gles2_implementation_autogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698