OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" | 5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" |
6 | 6 |
7 #include <stdio.h> | 7 #include <stdio.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <cmath> | 10 #include <cmath> |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
166 return gfx::OVERLAY_TRANSFORM_ROTATE_90; | 166 return gfx::OVERLAY_TRANSFORM_ROTATE_90; |
167 case GL_OVERLAY_TRANSFORM_ROTATE_180_CHROMIUM: | 167 case GL_OVERLAY_TRANSFORM_ROTATE_180_CHROMIUM: |
168 return gfx::OVERLAY_TRANSFORM_ROTATE_180; | 168 return gfx::OVERLAY_TRANSFORM_ROTATE_180; |
169 case GL_OVERLAY_TRANSFORM_ROTATE_270_CHROMIUM: | 169 case GL_OVERLAY_TRANSFORM_ROTATE_270_CHROMIUM: |
170 return gfx::OVERLAY_TRANSFORM_ROTATE_270; | 170 return gfx::OVERLAY_TRANSFORM_ROTATE_270; |
171 default: | 171 default: |
172 return gfx::OVERLAY_TRANSFORM_INVALID; | 172 return gfx::OVERLAY_TRANSFORM_INVALID; |
173 } | 173 } |
174 } | 174 } |
175 | 175 |
176 gfx::BufferFormat GetGFXOverlayStorageFormat(GLuint storage_format) { | |
177 switch (storage_format) { | |
178 case GL_BGR: | |
179 return gfx::BufferFormat::BGRX_8888; | |
180 case GL_BGRA_EXT: | |
181 return gfx::BufferFormat::BGRA_8888; | |
182 case GL_RGB_YCBCR_422_CHROMIUM: | |
183 return gfx::BufferFormat::UYVY_422; | |
184 default: | |
185 NOTREACHED(); | |
186 return gfx::BufferFormat::BGRX_8888; | |
187 } | |
188 } | |
189 | |
176 template <typename MANAGER_TYPE, typename OBJECT_TYPE> | 190 template <typename MANAGER_TYPE, typename OBJECT_TYPE> |
177 GLuint GetClientId(const MANAGER_TYPE* manager, const OBJECT_TYPE* object) { | 191 GLuint GetClientId(const MANAGER_TYPE* manager, const OBJECT_TYPE* object) { |
178 DCHECK(manager); | 192 DCHECK(manager); |
179 GLuint client_id = 0; | 193 GLuint client_id = 0; |
180 if (object) { | 194 if (object) { |
181 manager->GetClientId(object->service_id(), &client_id); | 195 manager->GetClientId(object->service_id(), &client_id); |
182 } | 196 } |
183 return client_id; | 197 return client_id; |
184 } | 198 } |
185 | 199 |
(...skipping 9240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
9426 gfx::OverlayTransform transform = GetGFXOverlayTransform(c.plane_transform); | 9440 gfx::OverlayTransform transform = GetGFXOverlayTransform(c.plane_transform); |
9427 if (transform == gfx::OVERLAY_TRANSFORM_INVALID) { | 9441 if (transform == gfx::OVERLAY_TRANSFORM_INVALID) { |
9428 LOCAL_SET_GL_ERROR(GL_INVALID_ENUM, | 9442 LOCAL_SET_GL_ERROR(GL_INVALID_ENUM, |
9429 "glScheduleOverlayPlaneCHROMIUM", | 9443 "glScheduleOverlayPlaneCHROMIUM", |
9430 "invalid transform enum"); | 9444 "invalid transform enum"); |
9431 return error::kNoError; | 9445 return error::kNoError; |
9432 } | 9446 } |
9433 if (!surface_->ScheduleOverlayPlane( | 9447 if (!surface_->ScheduleOverlayPlane( |
9434 c.plane_z_order, | 9448 c.plane_z_order, |
9435 transform, | 9449 transform, |
9450 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
| |
9436 image, | 9451 image, |
9437 gfx::Rect(c.bounds_x, c.bounds_y, c.bounds_width, c.bounds_height), | 9452 gfx::Rect(c.bounds_x, c.bounds_y, c.bounds_width, c.bounds_height), |
9438 gfx::RectF(c.uv_x, c.uv_y, c.uv_width, c.uv_height))) { | 9453 gfx::RectF(c.uv_x, c.uv_y, c.uv_width, c.uv_height), |
9454 static_cast<GLboolean>(c.handle_scaling))) { | |
piman
2015/12/11 08:32:25
Same here, what happens if handle_scaling doesn't
| |
9439 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, | 9455 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, |
9440 "glScheduleOverlayPlaneCHROMIUM", | 9456 "glScheduleOverlayPlaneCHROMIUM", |
9441 "failed to schedule overlay"); | 9457 "failed to schedule overlay"); |
9442 } | 9458 } |
9443 return error::kNoError; | 9459 return error::kNoError; |
9444 } | 9460 } |
9445 | 9461 |
9446 error::Error GLES2DecoderImpl::HandleScheduleCALayerCHROMIUM( | 9462 error::Error GLES2DecoderImpl::HandleScheduleCALayerCHROMIUM( |
9447 uint32 immediate_data_size, | 9463 uint32 immediate_data_size, |
9448 const void* cmd_data) { | 9464 const void* cmd_data) { |
(...skipping 6179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
15628 return error::kNoError; | 15644 return error::kNoError; |
15629 } | 15645 } |
15630 | 15646 |
15631 // Include the auto-generated part of this file. We split this because it means | 15647 // Include the auto-generated part of this file. We split this because it means |
15632 // we can easily edit the non-auto generated parts right here in this file | 15648 // we can easily edit the non-auto generated parts right here in this file |
15633 // instead of having to edit some template or the code generator. | 15649 // instead of having to edit some template or the code generator. |
15634 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 15650 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
15635 | 15651 |
15636 } // namespace gles2 | 15652 } // namespace gles2 |
15637 } // namespace gpu | 15653 } // namespace gpu |
OLD | NEW |