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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 #include "third_party/smhasher/src/City.h" | 70 #include "third_party/smhasher/src/City.h" |
71 #include "ui/gfx/buffer_types.h" | 71 #include "ui/gfx/buffer_types.h" |
72 #include "ui/gfx/geometry/point.h" | 72 #include "ui/gfx/geometry/point.h" |
73 #include "ui/gfx/geometry/rect.h" | 73 #include "ui/gfx/geometry/rect.h" |
74 #include "ui/gfx/geometry/rect_conversions.h" | 74 #include "ui/gfx/geometry/rect_conversions.h" |
75 #include "ui/gfx/geometry/size.h" | 75 #include "ui/gfx/geometry/size.h" |
76 #include "ui/gfx/gpu_memory_buffer.h" | 76 #include "ui/gfx/gpu_memory_buffer.h" |
77 #include "ui/gfx/overlay_transform.h" | 77 #include "ui/gfx/overlay_transform.h" |
78 #include "ui/gfx/transform.h" | 78 #include "ui/gfx/transform.h" |
79 #include "ui/gl/ca_renderer_layer_params.h" | 79 #include "ui/gl/ca_renderer_layer_params.h" |
| 80 #include "ui/gl/dc_renderer_layer_params.h" |
80 #include "ui/gl/gl_bindings.h" | 81 #include "ui/gl/gl_bindings.h" |
81 #include "ui/gl/gl_context.h" | 82 #include "ui/gl/gl_context.h" |
82 #include "ui/gl/gl_fence.h" | 83 #include "ui/gl/gl_fence.h" |
83 #include "ui/gl/gl_image.h" | 84 #include "ui/gl/gl_image.h" |
84 #include "ui/gl/gl_implementation.h" | 85 #include "ui/gl/gl_implementation.h" |
85 #include "ui/gl/gl_surface.h" | 86 #include "ui/gl/gl_surface.h" |
86 #include "ui/gl/gl_version_info.h" | 87 #include "ui/gl/gl_version_info.h" |
87 #include "ui/gl/gpu_timing.h" | 88 #include "ui/gl/gpu_timing.h" |
88 | 89 |
89 #if defined(OS_MACOSX) | 90 #if defined(OS_MACOSX) |
(...skipping 2068 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2158 GLuint* source_texture_service_id, | 2159 GLuint* source_texture_service_id, |
2159 GLenum* source_texture_target); | 2160 GLenum* source_texture_target); |
2160 | 2161 |
2161 // Whether a texture backed by a Chromium Image needs to emulate GL_RGB format | 2162 // Whether a texture backed by a Chromium Image needs to emulate GL_RGB format |
2162 // using GL_RGBA and glColorMask. | 2163 // using GL_RGBA and glColorMask. |
2163 bool ChromiumImageNeedsRGBEmulation(); | 2164 bool ChromiumImageNeedsRGBEmulation(); |
2164 | 2165 |
2165 // The GL_CHROMIUM_schedule_ca_layer extension requires that SwapBuffers and | 2166 // The GL_CHROMIUM_schedule_ca_layer extension requires that SwapBuffers and |
2166 // equivalent functions reset shared state. | 2167 // equivalent functions reset shared state. |
2167 void ClearScheduleCALayerState(); | 2168 void ClearScheduleCALayerState(); |
| 2169 void ClearScheduleDCLayerState(); |
2168 | 2170 |
2169 // Helper method to call glClear workaround. | 2171 // Helper method to call glClear workaround. |
2170 void ClearFramebufferForWorkaround(GLbitfield mask); | 2172 void ClearFramebufferForWorkaround(GLbitfield mask); |
2171 | 2173 |
2172 bool SupportsSeparateFramebufferBinds() const { | 2174 bool SupportsSeparateFramebufferBinds() const { |
2173 return (feature_info_->feature_flags().chromium_framebuffer_multisample || | 2175 return (feature_info_->feature_flags().chromium_framebuffer_multisample || |
2174 feature_info_->IsWebGL2OrES3Context()); | 2176 feature_info_->IsWebGL2OrES3Context()); |
2175 } | 2177 } |
2176 | 2178 |
2177 GLenum GetDrawFramebufferTarget() const { | 2179 GLenum GetDrawFramebufferTarget() const { |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2455 struct CALayerSharedState{ | 2457 struct CALayerSharedState{ |
2456 float opacity; | 2458 float opacity; |
2457 bool is_clipped; | 2459 bool is_clipped; |
2458 gfx::Rect clip_rect; | 2460 gfx::Rect clip_rect; |
2459 int sorting_context_id; | 2461 int sorting_context_id; |
2460 gfx::Transform transform; | 2462 gfx::Transform transform; |
2461 }; | 2463 }; |
2462 | 2464 |
2463 std::unique_ptr<CALayerSharedState> ca_layer_shared_state_; | 2465 std::unique_ptr<CALayerSharedState> ca_layer_shared_state_; |
2464 | 2466 |
| 2467 struct DCLayerSharedState { |
| 2468 float opacity; |
| 2469 bool is_clipped; |
| 2470 gfx::Rect clip_rect; |
| 2471 int z_order; |
| 2472 gfx::Transform transform; |
| 2473 }; |
| 2474 |
| 2475 std::unique_ptr<DCLayerSharedState> dc_layer_shared_state_; |
| 2476 |
2465 DISALLOW_COPY_AND_ASSIGN(GLES2DecoderImpl); | 2477 DISALLOW_COPY_AND_ASSIGN(GLES2DecoderImpl); |
2466 }; | 2478 }; |
2467 | 2479 |
2468 const GLES2DecoderImpl::CommandInfo GLES2DecoderImpl::command_info[] = { | 2480 const GLES2DecoderImpl::CommandInfo GLES2DecoderImpl::command_info[] = { |
2469 #define GLES2_CMD_OP(name) \ | 2481 #define GLES2_CMD_OP(name) \ |
2470 { \ | 2482 { \ |
2471 &GLES2DecoderImpl::Handle##name, cmds::name::kArgFlags, \ | 2483 &GLES2DecoderImpl::Handle##name, cmds::name::kArgFlags, \ |
2472 cmds::name::cmd_flags, \ | 2484 cmds::name::cmd_flags, \ |
2473 sizeof(cmds::name) / sizeof(CommandBufferEntry) - 1, \ | 2485 sizeof(cmds::name) / sizeof(CommandBufferEntry) - 1, \ |
2474 } \ | 2486 } \ |
(...skipping 9323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11798 TRACE_EVENT_CATEGORY_GROUP_ENABLED(TRACE_DISABLED_BY_DEFAULT("gpu.debug"), | 11810 TRACE_EVENT_CATEGORY_GROUP_ENABLED(TRACE_DISABLED_BY_DEFAULT("gpu.debug"), |
11799 &is_tracing); | 11811 &is_tracing); |
11800 if (is_tracing) { | 11812 if (is_tracing) { |
11801 bool is_offscreen = !!offscreen_target_frame_buffer_.get(); | 11813 bool is_offscreen = !!offscreen_target_frame_buffer_.get(); |
11802 ScopedFramebufferBinder binder(this, GetBoundDrawFramebufferServiceId()); | 11814 ScopedFramebufferBinder binder(this, GetBoundDrawFramebufferServiceId()); |
11803 gpu_state_tracer_->TakeSnapshotWithCurrentFramebuffer( | 11815 gpu_state_tracer_->TakeSnapshotWithCurrentFramebuffer( |
11804 is_offscreen ? offscreen_size_ : surface_->GetSize()); | 11816 is_offscreen ? offscreen_size_ : surface_->GetSize()); |
11805 } | 11817 } |
11806 | 11818 |
11807 ClearScheduleCALayerState(); | 11819 ClearScheduleCALayerState(); |
| 11820 ClearScheduleDCLayerState(); |
11808 | 11821 |
11809 std::vector<gfx::Rect> bounds(count); | 11822 std::vector<gfx::Rect> bounds(count); |
11810 for (GLsizei i = 0; i < count; ++i) { | 11823 for (GLsizei i = 0; i < count; ++i) { |
11811 bounds[i] = gfx::Rect(rects[i * 4 + 0], rects[i * 4 + 1], rects[i * 4 + 2], | 11824 bounds[i] = gfx::Rect(rects[i * 4 + 0], rects[i * 4 + 1], rects[i * 4 + 2], |
11812 rects[i * 4 + 3]); | 11825 rects[i * 4 + 3]); |
11813 } | 11826 } |
11814 FinishSwapBuffers(surface_->SwapBuffersWithBounds(bounds)); | 11827 FinishSwapBuffers(surface_->SwapBuffersWithBounds(bounds)); |
11815 } | 11828 } |
11816 | 11829 |
11817 error::Error GLES2DecoderImpl::HandlePostSubBufferCHROMIUM( | 11830 error::Error GLES2DecoderImpl::HandlePostSubBufferCHROMIUM( |
(...skipping 16 matching lines...) Expand all Loading... |
11834 TRACE_EVENT_CATEGORY_GROUP_ENABLED(TRACE_DISABLED_BY_DEFAULT("gpu.debug"), | 11847 TRACE_EVENT_CATEGORY_GROUP_ENABLED(TRACE_DISABLED_BY_DEFAULT("gpu.debug"), |
11835 &is_tracing); | 11848 &is_tracing); |
11836 if (is_tracing) { | 11849 if (is_tracing) { |
11837 bool is_offscreen = !!offscreen_target_frame_buffer_.get(); | 11850 bool is_offscreen = !!offscreen_target_frame_buffer_.get(); |
11838 ScopedFramebufferBinder binder(this, GetBoundDrawFramebufferServiceId()); | 11851 ScopedFramebufferBinder binder(this, GetBoundDrawFramebufferServiceId()); |
11839 gpu_state_tracer_->TakeSnapshotWithCurrentFramebuffer( | 11852 gpu_state_tracer_->TakeSnapshotWithCurrentFramebuffer( |
11840 is_offscreen ? offscreen_size_ : surface_->GetSize()); | 11853 is_offscreen ? offscreen_size_ : surface_->GetSize()); |
11841 } | 11854 } |
11842 | 11855 |
11843 ClearScheduleCALayerState(); | 11856 ClearScheduleCALayerState(); |
| 11857 ClearScheduleDCLayerState(); |
11844 | 11858 |
11845 if (supports_async_swap_) { | 11859 if (supports_async_swap_) { |
11846 TRACE_EVENT_ASYNC_BEGIN0("cc", "GLES2DecoderImpl::AsyncSwapBuffers", this); | 11860 TRACE_EVENT_ASYNC_BEGIN0("cc", "GLES2DecoderImpl::AsyncSwapBuffers", this); |
11847 surface_->PostSubBufferAsync( | 11861 surface_->PostSubBufferAsync( |
11848 c.x, c.y, c.width, c.height, | 11862 c.x, c.y, c.width, c.height, |
11849 base::Bind(&GLES2DecoderImpl::FinishSwapBuffers, | 11863 base::Bind(&GLES2DecoderImpl::FinishSwapBuffers, |
11850 base::AsWeakPtr(this))); | 11864 base::AsWeakPtr(this))); |
11851 } else { | 11865 } else { |
11852 FinishSwapBuffers(surface_->PostSubBuffer(c.x, c.y, c.width, c.height)); | 11866 FinishSwapBuffers(surface_->PostSubBuffer(c.x, c.y, c.width, c.height)); |
11853 } | 11867 } |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11977 ca_layer_shared_state_->transform, image, contents_rect, | 11991 ca_layer_shared_state_->transform, image, contents_rect, |
11978 gfx::ToEnclosingRect(bounds_rect), c.background_color, c.edge_aa_mask, | 11992 gfx::ToEnclosingRect(bounds_rect), c.background_color, c.edge_aa_mask, |
11979 ca_layer_shared_state_->opacity, filter); | 11993 ca_layer_shared_state_->opacity, filter); |
11980 if (!surface_->ScheduleCALayer(params)) { | 11994 if (!surface_->ScheduleCALayer(params)) { |
11981 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, "glScheduleCALayerCHROMIUM", | 11995 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, "glScheduleCALayerCHROMIUM", |
11982 "failed to schedule CALayer"); | 11996 "failed to schedule CALayer"); |
11983 } | 11997 } |
11984 return error::kNoError; | 11998 return error::kNoError; |
11985 } | 11999 } |
11986 | 12000 |
| 12001 error::Error GLES2DecoderImpl::HandleScheduleDCLayerSharedStateCHROMIUM( |
| 12002 uint32_t immediate_data_size, |
| 12003 const volatile void* cmd_data) { |
| 12004 const volatile gles2::cmds::ScheduleDCLayerSharedStateCHROMIUM& c = |
| 12005 *static_cast< |
| 12006 const volatile gles2::cmds::ScheduleDCLayerSharedStateCHROMIUM*>( |
| 12007 cmd_data); |
| 12008 |
| 12009 const GLfloat* mem = GetSharedMemoryAs<const GLfloat*>(c.shm_id, c.shm_offset, |
| 12010 20 * sizeof(GLfloat)); |
| 12011 if (!mem) { |
| 12012 return error::kOutOfBounds; |
| 12013 } |
| 12014 gfx::RectF clip_rect(mem[0], mem[1], mem[2], mem[3]); |
| 12015 gfx::Transform transform(mem[4], mem[8], mem[12], mem[16], mem[5], mem[9], |
| 12016 mem[13], mem[17], mem[6], mem[10], mem[14], mem[18], |
| 12017 mem[7], mem[11], mem[15], mem[19]); |
| 12018 dc_layer_shared_state_.reset(new DCLayerSharedState); |
| 12019 dc_layer_shared_state_->opacity = c.opacity; |
| 12020 dc_layer_shared_state_->is_clipped = c.is_clipped ? true : false; |
| 12021 dc_layer_shared_state_->clip_rect = gfx::ToEnclosingRect(clip_rect); |
| 12022 dc_layer_shared_state_->z_order = c.z_order; |
| 12023 dc_layer_shared_state_->transform = transform; |
| 12024 return error::kNoError; |
| 12025 } |
| 12026 |
| 12027 error::Error GLES2DecoderImpl::HandleScheduleDCLayerCHROMIUM( |
| 12028 uint32_t immediate_data_size, |
| 12029 const volatile void* cmd_data) { |
| 12030 const volatile gles2::cmds::ScheduleDCLayerCHROMIUM& c = |
| 12031 *static_cast<const volatile gles2::cmds::ScheduleDCLayerCHROMIUM*>( |
| 12032 cmd_data); |
| 12033 GLuint filter = c.filter; |
| 12034 if (filter != GL_NEAREST && filter != GL_LINEAR) { |
| 12035 LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, "glScheduleDCLayerCHROMIUM", |
| 12036 "invalid filter"); |
| 12037 return error::kNoError; |
| 12038 } |
| 12039 |
| 12040 if (!dc_layer_shared_state_) { |
| 12041 LOCAL_SET_GL_ERROR( |
| 12042 GL_INVALID_OPERATION, "glScheduleDCLayerCHROMIUM", |
| 12043 "glScheduleDCLayerSharedStateCHROMIUM has not been called"); |
| 12044 return error::kNoError; |
| 12045 } |
| 12046 |
| 12047 gl::GLImage* image = nullptr; |
| 12048 GLuint contents_texture_id = c.contents_texture_id; |
| 12049 if (contents_texture_id) { |
| 12050 TextureRef* ref = texture_manager()->GetTexture(contents_texture_id); |
| 12051 if (!ref) { |
| 12052 LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, "glScheduleDCLayerCHROMIUM", |
| 12053 "unknown texture"); |
| 12054 return error::kNoError; |
| 12055 } |
| 12056 Texture::ImageState image_state; |
| 12057 image = ref->texture()->GetLevelImage(ref->texture()->target(), 0, |
| 12058 &image_state); |
| 12059 if (!image) { |
| 12060 LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, "glScheduleDCLayerCHROMIUM", |
| 12061 "unsupported texture format"); |
| 12062 return error::kNoError; |
| 12063 } |
| 12064 } |
| 12065 |
| 12066 const GLfloat* mem = GetSharedMemoryAs<const GLfloat*>(c.shm_id, c.shm_offset, |
| 12067 8 * sizeof(GLfloat)); |
| 12068 if (!mem) { |
| 12069 return error::kOutOfBounds; |
| 12070 } |
| 12071 gfx::RectF contents_rect(mem[0], mem[1], mem[2], mem[3]); |
| 12072 gfx::RectF bounds_rect(mem[4], mem[5], mem[6], mem[7]); |
| 12073 |
| 12074 ui::DCRendererLayerParams params = ui::DCRendererLayerParams( |
| 12075 dc_layer_shared_state_->is_clipped, dc_layer_shared_state_->clip_rect, |
| 12076 dc_layer_shared_state_->z_order, dc_layer_shared_state_->transform, image, |
| 12077 contents_rect, gfx::ToEnclosingRect(bounds_rect), c.background_color, |
| 12078 c.edge_aa_mask, dc_layer_shared_state_->opacity, filter); |
| 12079 if (!surface_->ScheduleDCLayer(params)) { |
| 12080 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, "glScheduleDCLayerCHROMIUM", |
| 12081 "failed to schedule DCLayer"); |
| 12082 } |
| 12083 return error::kNoError; |
| 12084 } |
| 12085 |
11987 void GLES2DecoderImpl::DoScheduleCALayerInUseQueryCHROMIUM( | 12086 void GLES2DecoderImpl::DoScheduleCALayerInUseQueryCHROMIUM( |
11988 GLsizei count, | 12087 GLsizei count, |
11989 const volatile GLuint* textures) { | 12088 const volatile GLuint* textures) { |
11990 std::vector<gl::GLSurface::CALayerInUseQuery> queries; | 12089 std::vector<gl::GLSurface::CALayerInUseQuery> queries; |
11991 queries.reserve(count); | 12090 queries.reserve(count); |
11992 for (GLsizei i = 0; i < count; ++i) { | 12091 for (GLsizei i = 0; i < count; ++i) { |
11993 gl::GLImage* image = nullptr; | 12092 gl::GLImage* image = nullptr; |
11994 GLuint texture_id = textures[i]; | 12093 GLuint texture_id = textures[i]; |
11995 if (texture_id) { | 12094 if (texture_id) { |
11996 TextureRef* ref = texture_manager()->GetTexture(texture_id); | 12095 TextureRef* ref = texture_manager()->GetTexture(texture_id); |
(...skipping 3301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
15298 bool is_tracing; | 15397 bool is_tracing; |
15299 TRACE_EVENT_CATEGORY_GROUP_ENABLED(TRACE_DISABLED_BY_DEFAULT("gpu.debug"), | 15398 TRACE_EVENT_CATEGORY_GROUP_ENABLED(TRACE_DISABLED_BY_DEFAULT("gpu.debug"), |
15300 &is_tracing); | 15399 &is_tracing); |
15301 if (is_tracing) { | 15400 if (is_tracing) { |
15302 ScopedFramebufferBinder binder(this, GetBoundDrawFramebufferServiceId()); | 15401 ScopedFramebufferBinder binder(this, GetBoundDrawFramebufferServiceId()); |
15303 gpu_state_tracer_->TakeSnapshotWithCurrentFramebuffer( | 15402 gpu_state_tracer_->TakeSnapshotWithCurrentFramebuffer( |
15304 is_offscreen ? offscreen_size_ : surface_->GetSize()); | 15403 is_offscreen ? offscreen_size_ : surface_->GetSize()); |
15305 } | 15404 } |
15306 | 15405 |
15307 ClearScheduleCALayerState(); | 15406 ClearScheduleCALayerState(); |
| 15407 ClearScheduleDCLayerState(); |
15308 | 15408 |
15309 // If offscreen then don't actually SwapBuffers to the display. Just copy | 15409 // If offscreen then don't actually SwapBuffers to the display. Just copy |
15310 // the rendered frame to another frame buffer. | 15410 // the rendered frame to another frame buffer. |
15311 if (is_offscreen) { | 15411 if (is_offscreen) { |
15312 TRACE_EVENT2("gpu", "Offscreen", | 15412 TRACE_EVENT2("gpu", "Offscreen", |
15313 "width", offscreen_size_.width(), "height", offscreen_size_.height()); | 15413 "width", offscreen_size_.width(), "height", offscreen_size_.height()); |
15314 if (offscreen_size_ != offscreen_saved_color_texture_->size()) { | 15414 if (offscreen_size_ != offscreen_saved_color_texture_->size()) { |
15315 // Workaround for NVIDIA driver bug on OS X; crbug.com/89557, | 15415 // Workaround for NVIDIA driver bug on OS X; crbug.com/89557, |
15316 // crbug.com/94163. TODO(kbr): figure out reproduction so Apple will | 15416 // crbug.com/94163. TODO(kbr): figure out reproduction so Apple will |
15317 // fix this. | 15417 // fix this. |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
15418 } | 15518 } |
15419 | 15519 |
15420 void GLES2DecoderImpl::DoCommitOverlayPlanes() { | 15520 void GLES2DecoderImpl::DoCommitOverlayPlanes() { |
15421 TRACE_EVENT0("gpu", "GLES2DecoderImpl::DoCommitOverlayPlanes"); | 15521 TRACE_EVENT0("gpu", "GLES2DecoderImpl::DoCommitOverlayPlanes"); |
15422 if (!supports_commit_overlay_planes_) { | 15522 if (!supports_commit_overlay_planes_) { |
15423 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, "glCommitOverlayPlanes", | 15523 LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, "glCommitOverlayPlanes", |
15424 "command not supported by surface"); | 15524 "command not supported by surface"); |
15425 return; | 15525 return; |
15426 } | 15526 } |
15427 ClearScheduleCALayerState(); | 15527 ClearScheduleCALayerState(); |
| 15528 ClearScheduleDCLayerState(); |
15428 if (supports_async_swap_) { | 15529 if (supports_async_swap_) { |
15429 surface_->CommitOverlayPlanesAsync(base::Bind( | 15530 surface_->CommitOverlayPlanesAsync(base::Bind( |
15430 &GLES2DecoderImpl::FinishSwapBuffers, base::AsWeakPtr(this))); | 15531 &GLES2DecoderImpl::FinishSwapBuffers, base::AsWeakPtr(this))); |
15431 } else { | 15532 } else { |
15432 FinishSwapBuffers(surface_->CommitOverlayPlanes()); | 15533 FinishSwapBuffers(surface_->CommitOverlayPlanes()); |
15433 } | 15534 } |
15434 } | 15535 } |
15435 | 15536 |
15436 void GLES2DecoderImpl::DoSwapInterval(int interval) { | 15537 void GLES2DecoderImpl::DoSwapInterval(int interval) { |
15437 context_->SetSwapInterval(interval); | 15538 context_->SetSwapInterval(interval); |
(...skipping 3756 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
19194 | 19295 |
19195 bool GLES2DecoderImpl::ChromiumImageNeedsRGBEmulation() { | 19296 bool GLES2DecoderImpl::ChromiumImageNeedsRGBEmulation() { |
19196 gpu::ImageFactory* factory = GetContextGroup()->image_factory(); | 19297 gpu::ImageFactory* factory = GetContextGroup()->image_factory(); |
19197 return factory ? !factory->SupportsFormatRGB() : false; | 19298 return factory ? !factory->SupportsFormatRGB() : false; |
19198 } | 19299 } |
19199 | 19300 |
19200 void GLES2DecoderImpl::ClearScheduleCALayerState() { | 19301 void GLES2DecoderImpl::ClearScheduleCALayerState() { |
19201 ca_layer_shared_state_.reset(); | 19302 ca_layer_shared_state_.reset(); |
19202 } | 19303 } |
19203 | 19304 |
| 19305 void GLES2DecoderImpl::ClearScheduleDCLayerState() { |
| 19306 dc_layer_shared_state_.reset(); |
| 19307 } |
| 19308 |
19204 void GLES2DecoderImpl::ClearFramebufferForWorkaround(GLbitfield mask) { | 19309 void GLES2DecoderImpl::ClearFramebufferForWorkaround(GLbitfield mask) { |
19205 ScopedGLErrorSuppressor suppressor("GLES2DecoderImpl::ClearWorkaround", | 19310 ScopedGLErrorSuppressor suppressor("GLES2DecoderImpl::ClearWorkaround", |
19206 GetErrorState()); | 19311 GetErrorState()); |
19207 clear_framebuffer_blit_->ClearFramebuffer( | 19312 clear_framebuffer_blit_->ClearFramebuffer( |
19208 this, GetBoundReadFramebufferSize(), mask, state_.color_clear_red, | 19313 this, GetBoundReadFramebufferSize(), mask, state_.color_clear_red, |
19209 state_.color_clear_green, state_.color_clear_blue, | 19314 state_.color_clear_green, state_.color_clear_blue, |
19210 state_.color_clear_alpha, state_.depth_clear, state_.stencil_clear); | 19315 state_.color_clear_alpha, state_.depth_clear, state_.stencil_clear); |
19211 } | 19316 } |
19212 | 19317 |
19213 error::Error GLES2DecoderImpl::HandleBindFragmentInputLocationCHROMIUMBucket( | 19318 error::Error GLES2DecoderImpl::HandleBindFragmentInputLocationCHROMIUMBucket( |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
19368 } | 19473 } |
19369 | 19474 |
19370 // Include the auto-generated part of this file. We split this because it means | 19475 // Include the auto-generated part of this file. We split this because it means |
19371 // we can easily edit the non-auto generated parts right here in this file | 19476 // we can easily edit the non-auto generated parts right here in this file |
19372 // instead of having to edit some template or the code generator. | 19477 // instead of having to edit some template or the code generator. |
19373 #include "base/macros.h" | 19478 #include "base/macros.h" |
19374 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 19479 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
19375 | 19480 |
19376 } // namespace gles2 | 19481 } // namespace gles2 |
19377 } // namespace gpu | 19482 } // namespace gpu |
OLD | NEW |