| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "cc/layers/io_surface_layer_impl.h" | 5 #include "cc/layers/io_surface_layer_impl.h" |
| 6 | 6 |
| 7 #include "base/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
| 8 #include "cc/output/gl_renderer.h" // For the GLC() macro. | 8 #include "cc/output/gl_renderer.h" // For the GLC() macro. |
| 9 #include "cc/output/output_surface.h" | 9 #include "cc/output/output_surface.h" |
| 10 #include "cc/quads/io_surface_draw_quad.h" | 10 #include "cc/quads/io_surface_draw_quad.h" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 io_surface_resource_id_ = resource_provider->CreateResourceFromIOSurface( | 59 io_surface_resource_id_ = resource_provider->CreateResourceFromIOSurface( |
| 60 io_surface_size_, io_surface_id_); | 60 io_surface_size_, io_surface_id_); |
| 61 io_surface_changed_ = false; | 61 io_surface_changed_ = false; |
| 62 } | 62 } |
| 63 | 63 |
| 64 return LayerImpl::WillDraw(draw_mode, resource_provider); | 64 return LayerImpl::WillDraw(draw_mode, resource_provider); |
| 65 } | 65 } |
| 66 | 66 |
| 67 void IOSurfaceLayerImpl::AppendQuads( | 67 void IOSurfaceLayerImpl::AppendQuads( |
| 68 RenderPass* render_pass, | 68 RenderPass* render_pass, |
| 69 const Occlusion& occlusion_in_content_space, | |
| 70 AppendQuadsData* append_quads_data) { | 69 AppendQuadsData* append_quads_data) { |
| 71 SharedQuadState* shared_quad_state = | 70 SharedQuadState* shared_quad_state = |
| 72 render_pass->CreateAndAppendSharedQuadState(); | 71 render_pass->CreateAndAppendSharedQuadState(); |
| 73 PopulateSharedQuadState(shared_quad_state); | 72 PopulateSharedQuadState(shared_quad_state); |
| 74 | 73 |
| 75 AppendDebugBorderQuad( | 74 AppendDebugBorderQuad( |
| 76 render_pass, content_bounds(), shared_quad_state, append_quads_data); | 75 render_pass, content_bounds(), shared_quad_state, append_quads_data); |
| 77 | 76 |
| 78 gfx::Rect quad_rect(content_bounds()); | 77 gfx::Rect quad_rect(content_bounds()); |
| 79 gfx::Rect opaque_rect(contents_opaque() ? quad_rect : gfx::Rect()); | 78 gfx::Rect opaque_rect(contents_opaque() ? quad_rect : gfx::Rect()); |
| 80 gfx::Rect visible_quad_rect = | 79 gfx::Rect visible_quad_rect = |
| 81 occlusion_in_content_space.GetUnoccludedContentRect(quad_rect); | 80 draw_properties().occlusion_in_content_space.GetUnoccludedContentRect( |
| 81 quad_rect); |
| 82 if (visible_quad_rect.IsEmpty()) | 82 if (visible_quad_rect.IsEmpty()) |
| 83 return; | 83 return; |
| 84 | 84 |
| 85 IOSurfaceDrawQuad* quad = | 85 IOSurfaceDrawQuad* quad = |
| 86 render_pass->CreateAndAppendDrawQuad<IOSurfaceDrawQuad>(); | 86 render_pass->CreateAndAppendDrawQuad<IOSurfaceDrawQuad>(); |
| 87 quad->SetNew(shared_quad_state, | 87 quad->SetNew(shared_quad_state, |
| 88 quad_rect, | 88 quad_rect, |
| 89 opaque_rect, | 89 opaque_rect, |
| 90 visible_quad_rect, | 90 visible_quad_rect, |
| 91 io_surface_size_, | 91 io_surface_size_, |
| (...skipping 15 matching lines...) Expand all Loading... |
| 107 | 107 |
| 108 io_surface_id_ = io_surface_id; | 108 io_surface_id_ = io_surface_id; |
| 109 io_surface_size_ = size; | 109 io_surface_size_ = size; |
| 110 } | 110 } |
| 111 | 111 |
| 112 const char* IOSurfaceLayerImpl::LayerTypeAsString() const { | 112 const char* IOSurfaceLayerImpl::LayerTypeAsString() const { |
| 113 return "cc::IOSurfaceLayerImpl"; | 113 return "cc::IOSurfaceLayerImpl"; |
| 114 } | 114 } |
| 115 | 115 |
| 116 } // namespace cc | 116 } // namespace cc |
| OLD | NEW |