Chromium Code Reviews| 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 <limits.h> | 7 #include <limits.h> |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 #include <stdio.h> | 10 #include <stdio.h> |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 55 #include "gpu/command_buffer/service/query_manager.h" | 55 #include "gpu/command_buffer/service/query_manager.h" |
| 56 #include "gpu/command_buffer/service/renderbuffer_manager.h" | 56 #include "gpu/command_buffer/service/renderbuffer_manager.h" |
| 57 #include "gpu/command_buffer/service/sampler_manager.h" | 57 #include "gpu/command_buffer/service/sampler_manager.h" |
| 58 #include "gpu/command_buffer/service/shader_manager.h" | 58 #include "gpu/command_buffer/service/shader_manager.h" |
| 59 #include "gpu/command_buffer/service/shader_translator.h" | 59 #include "gpu/command_buffer/service/shader_translator.h" |
| 60 #include "gpu/command_buffer/service/texture_manager.h" | 60 #include "gpu/command_buffer/service/texture_manager.h" |
| 61 #include "gpu/command_buffer/service/transform_feedback_manager.h" | 61 #include "gpu/command_buffer/service/transform_feedback_manager.h" |
| 62 #include "gpu/command_buffer/service/vertex_array_manager.h" | 62 #include "gpu/command_buffer/service/vertex_array_manager.h" |
| 63 #include "gpu/command_buffer/service/vertex_attrib_manager.h" | 63 #include "gpu/command_buffer/service/vertex_attrib_manager.h" |
| 64 #include "third_party/smhasher/src/City.h" | 64 #include "third_party/smhasher/src/City.h" |
| 65 #include "ui/accelerated_widget_mac/ca_renderer_layer_params.h" | |
| 65 #include "ui/gfx/geometry/point.h" | 66 #include "ui/gfx/geometry/point.h" |
| 66 #include "ui/gfx/geometry/rect.h" | 67 #include "ui/gfx/geometry/rect.h" |
| 68 #include "ui/gfx/geometry/rect_conversions.h" | |
| 67 #include "ui/gfx/geometry/size.h" | 69 #include "ui/gfx/geometry/size.h" |
| 68 #include "ui/gfx/overlay_transform.h" | 70 #include "ui/gfx/overlay_transform.h" |
| 69 #include "ui/gfx/transform.h" | 71 #include "ui/gfx/transform.h" |
| 70 #include "ui/gl/gl_bindings.h" | 72 #include "ui/gl/gl_bindings.h" |
| 71 #include "ui/gl/gl_context.h" | 73 #include "ui/gl/gl_context.h" |
| 72 #include "ui/gl/gl_fence.h" | 74 #include "ui/gl/gl_fence.h" |
| 73 #include "ui/gl/gl_image.h" | 75 #include "ui/gl/gl_image.h" |
| 74 #include "ui/gl/gl_implementation.h" | 76 #include "ui/gl/gl_implementation.h" |
| 75 #include "ui/gl/gl_surface.h" | 77 #include "ui/gl/gl_surface.h" |
| 76 #include "ui/gl/gl_version_info.h" | 78 #include "ui/gl/gl_version_info.h" |
| (...skipping 10247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 10324 if (!mem) { | 10326 if (!mem) { |
| 10325 return error::kOutOfBounds; | 10327 return error::kOutOfBounds; |
| 10326 } | 10328 } |
| 10327 gfx::RectF contents_rect(mem[0], mem[1], mem[2], mem[3]); | 10329 gfx::RectF contents_rect(mem[0], mem[1], mem[2], mem[3]); |
| 10328 gfx::RectF bounds_rect(mem[4], mem[5], mem[6], mem[7]); | 10330 gfx::RectF bounds_rect(mem[4], mem[5], mem[6], mem[7]); |
| 10329 gfx::RectF clip_rect(mem[8], mem[9], mem[10], mem[11]); | 10331 gfx::RectF clip_rect(mem[8], mem[9], mem[10], mem[11]); |
| 10330 gfx::Transform transform(mem[12], mem[16], mem[20], mem[24], | 10332 gfx::Transform transform(mem[12], mem[16], mem[20], mem[24], |
| 10331 mem[13], mem[17], mem[21], mem[25], | 10333 mem[13], mem[17], mem[21], mem[25], |
| 10332 mem[14], mem[18], mem[22], mem[26], | 10334 mem[14], mem[18], mem[22], mem[26], |
| 10333 mem[15], mem[19], mem[23], mem[27]); | 10335 mem[15], mem[19], mem[23], mem[27]); |
| 10334 if (!surface_->ScheduleCALayer( | 10336 |
|
piman
2016/06/28 00:28:09
This, and the headers will now need to be in a #if
kirr
2016/06/28 10:25:48
Done.
Thanks. I've replaced mac-specific surfaces
| |
| 10335 image, contents_rect, c.opacity, c.background_color, c.edge_aa_mask, | 10337 base::ScopedCFTypeRef<IOSurfaceRef> io_surface; |
| 10336 bounds_rect, c.is_clipped ? true : false, clip_rect, transform, | 10338 base::ScopedCFTypeRef<CVPixelBufferRef> cv_pixel_buffer; |
| 10337 c.sorting_context_id, filter)) { | 10339 if (image) { |
| 10340 gl::GLImageIOSurface* io_surface_image = | |
| 10341 static_cast<gl::GLImageIOSurface*>(image); | |
|
ccameron
2016/06/28 00:05:14
Add a TODO(ccameron): Remove this cast (crbug.com/
kirr
2016/06/28 10:25:48
Done.
| |
| 10342 io_surface = io_surface_image->io_surface(); | |
| 10343 cv_pixel_buffer = io_surface_image->cv_pixel_buffer(); | |
| 10344 } | |
| 10345 | |
| 10346 ui::CARendererLayerParams params = ui::CARendererLayerParams( | |
| 10347 c.is_clipped ? true : false, gfx::ToEnclosingRect(clip_rect), | |
| 10348 c.sorting_context_id, transform, io_surface, cv_pixel_buffer, | |
| 10349 contents_rect, gfx::ToEnclosingRect(bounds_rect), c.background_color, | |
| 10350 c.edge_aa_mask, c.opacity, filter); | |
| 10351 if (!surface_->ScheduleCALayer(params)) { | |
| 10338 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, "glScheduleCALayerCHROMIUM", | 10352 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, "glScheduleCALayerCHROMIUM", |
| 10339 "failed to schedule CALayer"); | 10353 "failed to schedule CALayer"); |
| 10340 } | 10354 } |
| 10341 return error::kNoError; | 10355 return error::kNoError; |
| 10342 } | 10356 } |
| 10343 | 10357 |
| 10344 error::Error GLES2DecoderImpl::GetAttribLocationHelper( | 10358 error::Error GLES2DecoderImpl::GetAttribLocationHelper( |
| 10345 GLuint client_id, | 10359 GLuint client_id, |
| 10346 uint32_t location_shm_id, | 10360 uint32_t location_shm_id, |
| 10347 uint32_t location_shm_offset, | 10361 uint32_t location_shm_offset, |
| (...skipping 6442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 16790 } | 16804 } |
| 16791 | 16805 |
| 16792 // Include the auto-generated part of this file. We split this because it means | 16806 // Include the auto-generated part of this file. We split this because it means |
| 16793 // we can easily edit the non-auto generated parts right here in this file | 16807 // we can easily edit the non-auto generated parts right here in this file |
| 16794 // instead of having to edit some template or the code generator. | 16808 // instead of having to edit some template or the code generator. |
| 16795 #include "base/macros.h" | 16809 #include "base/macros.h" |
| 16796 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 16810 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
| 16797 | 16811 |
| 16798 } // namespace gles2 | 16812 } // namespace gles2 |
| 16799 } // namespace gpu | 16813 } // namespace gpu |
| OLD | NEW |