| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/surface_layer_impl.h" | 5 #include "cc/layers/surface_layer_impl.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include "base/trace_event/trace_event_argument.h" | 9 #include "base/trace_event/trace_event_argument.h" |
| 10 #include "cc/debug/debug_colors.h" | 10 #include "cc/debug/debug_colors.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 if (primary && fallback_surface_info_.id() != primary_surface_info_.id()) { | 71 if (primary && fallback_surface_info_.id() != primary_surface_info_.id()) { |
| 72 primary->fallback_quad = CreateSurfaceDrawQuad( | 72 primary->fallback_quad = CreateSurfaceDrawQuad( |
| 73 render_pass, SurfaceDrawQuadType::FALLBACK, fallback_surface_info_); | 73 render_pass, SurfaceDrawQuadType::FALLBACK, fallback_surface_info_); |
| 74 } | 74 } |
| 75 } | 75 } |
| 76 | 76 |
| 77 SurfaceDrawQuad* SurfaceLayerImpl::CreateSurfaceDrawQuad( | 77 SurfaceDrawQuad* SurfaceLayerImpl::CreateSurfaceDrawQuad( |
| 78 RenderPass* render_pass, | 78 RenderPass* render_pass, |
| 79 SurfaceDrawQuadType surface_draw_quad_type, | 79 SurfaceDrawQuadType surface_draw_quad_type, |
| 80 const SurfaceInfo& surface_info) { | 80 const SurfaceInfo& surface_info) { |
| 81 if (!surface_info.id().is_valid()) | 81 if (!surface_info.is_valid()) |
| 82 return nullptr; | 82 return nullptr; |
| 83 | 83 |
| 84 gfx::Rect quad_rect(surface_info.size_in_pixels()); | 84 gfx::Rect quad_rect(surface_info.size_in_pixels()); |
| 85 gfx::Rect visible_quad_rect = | 85 gfx::Rect visible_quad_rect = |
| 86 draw_properties().occlusion_in_content_space.GetUnoccludedContentRect( | 86 draw_properties().occlusion_in_content_space.GetUnoccludedContentRect( |
| 87 gfx::Rect(bounds())); | 87 gfx::Rect(bounds())); |
| 88 | 88 |
| 89 float layer_to_content_scale_x, layer_to_content_scale_y; | 89 float layer_to_content_scale_x, layer_to_content_scale_y; |
| 90 if (stretch_content_to_fill_bounds_) { | 90 if (stretch_content_to_fill_bounds_) { |
| 91 // Stretches the surface contents to exactly fill the layer bounds, | 91 // Stretches the surface contents to exactly fill the layer bounds, |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 dict->SetString("surface_id", primary_surface_info_.id().ToString()); | 218 dict->SetString("surface_id", primary_surface_info_.id().ToString()); |
| 219 dict->SetString("fallback_surface_id", | 219 dict->SetString("fallback_surface_id", |
| 220 fallback_surface_info_.id().ToString()); | 220 fallback_surface_info_.id().ToString()); |
| 221 } | 221 } |
| 222 | 222 |
| 223 const char* SurfaceLayerImpl::LayerTypeAsString() const { | 223 const char* SurfaceLayerImpl::LayerTypeAsString() const { |
| 224 return "cc::SurfaceLayerImpl"; | 224 return "cc::SurfaceLayerImpl"; |
| 225 } | 225 } |
| 226 | 226 |
| 227 } // namespace cc | 227 } // namespace cc |
| OLD | NEW |