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

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: 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 1dec5cf2002c7dfcdf9db9099edbdfd5c3b84b1b..3ecd3f0bd4fee60ffaf039a7f8e5d5d7f9c53a31 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -173,6 +173,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);
@@ -9433,9 +9447,11 @@ error::Error GLES2DecoderImpl::HandleScheduleOverlayPlaneCHROMIUM(
if (!surface_->ScheduleOverlayPlane(
c.plane_z_order,
transform,
+ GetGFXOverlayStorageFormat(c.storage_format),
piman 2015/12/11 08:32:25 When would this be different than the image's Buff
kalyank 2015/12/11 19:22:35 This might be different in case HardwarePlanes sup
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))) {
piman 2015/12/11 08:32:25 Same here, what happens if handle_scaling doesn't
LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION,
"glScheduleOverlayPlaneCHROMIUM",
"failed to schedule overlay");

Powered by Google App Engine
This is Rietveld 408576698