Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(18)

Side by Side Diff: cc/layers/surface_layer_impl.cc

Issue 2720503008: Add cc::SurfaceInfo::is_valid() (Closed)
Patch Set: Added Log() Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/layers/surface_layer.cc ('k') | cc/surfaces/surface_info.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « cc/layers/surface_layer.cc ('k') | cc/surfaces/surface_info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698