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

Unified Diff: gpu/command_buffer/service/gles2_cmd_decoder.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/service/gles2_cmd_decoder.cc
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index e8bbe5885459434f3dff96c195f981ae1b6ee30d..409ad4af595b5734cc1f20be4e992f5113688cdb 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -174,6 +174,20 @@ gfx::OverlayTransform GetGFXOverlayTransform(GLenum plane_transform) {
}
}
+gfx::BufferFormat GetGFXOverlayStorageFormat(GLuint storage_format) {
+ switch (storage_format) {
+ case GL_BGR:
+ return gfx::BufferFormat::BGRX_8888;
+ case GL_BGRA_EXT:
+ return gfx::BufferFormat::BGRA_8888;
+ case GL_RGB_YCBCR_422_CHROMIUM:
+ return gfx::BufferFormat::UYVY_422;
+ default:
+ NOTREACHED();
+ return gfx::BufferFormat::BGRX_8888;
+ }
+}
+
template <typename MANAGER_TYPE, typename OBJECT_TYPE>
GLuint GetClientId(const MANAGER_TYPE* manager, const OBJECT_TYPE* object) {
DCHECK(manager);
@@ -9584,9 +9598,11 @@ error::Error GLES2DecoderImpl::HandleScheduleOverlayPlaneCHROMIUM(
if (!surface_->ScheduleOverlayPlane(
c.plane_z_order,
transform,
+ GetGFXOverlayStorageFormat(c.storage_format),
image,
gfx::Rect(c.bounds_x, c.bounds_y, c.bounds_width, c.bounds_height),
- gfx::RectF(c.uv_x, c.uv_y, c.uv_width, c.uv_height))) {
+ gfx::RectF(c.uv_x, c.uv_y, c.uv_width, c.uv_height),
+ static_cast<GLboolean>(c.handle_scaling))) {
LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION,
"glScheduleOverlayPlaneCHROMIUM",
"failed to schedule overlay");

Powered by Google App Engine
This is Rietveld 408576698