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

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

Issue 935333002: Update from https://crrev.com/316786 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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_impl.h ('k') | cc/layers/texture_layer_impl.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 "base/trace_event/trace_event_argument.h" 7 #include "base/trace_event/trace_event_argument.h"
8 #include "cc/debug/debug_colors.h" 8 #include "cc/debug/debug_colors.h"
9 #include "cc/quads/surface_draw_quad.h" 9 #include "cc/quads/surface_draw_quad.h"
10 #include "cc/trees/occlusion.h" 10 #include "cc/trees/occlusion.h"
(...skipping 20 matching lines...) Expand all
31 } 31 }
32 32
33 void SurfaceLayerImpl::PushPropertiesTo(LayerImpl* layer) { 33 void SurfaceLayerImpl::PushPropertiesTo(LayerImpl* layer) {
34 LayerImpl::PushPropertiesTo(layer); 34 LayerImpl::PushPropertiesTo(layer);
35 SurfaceLayerImpl* layer_impl = static_cast<SurfaceLayerImpl*>(layer); 35 SurfaceLayerImpl* layer_impl = static_cast<SurfaceLayerImpl*>(layer);
36 36
37 layer_impl->SetSurfaceId(surface_id_); 37 layer_impl->SetSurfaceId(surface_id_);
38 } 38 }
39 39
40 void SurfaceLayerImpl::AppendQuads(RenderPass* render_pass, 40 void SurfaceLayerImpl::AppendQuads(RenderPass* render_pass,
41 const Occlusion& occlusion_in_content_space,
42 AppendQuadsData* append_quads_data) { 41 AppendQuadsData* append_quads_data) {
43 SharedQuadState* shared_quad_state = 42 SharedQuadState* shared_quad_state =
44 render_pass->CreateAndAppendSharedQuadState(); 43 render_pass->CreateAndAppendSharedQuadState();
45 PopulateSharedQuadState(shared_quad_state); 44 PopulateSharedQuadState(shared_quad_state);
46 45
47 AppendDebugBorderQuad( 46 AppendDebugBorderQuad(
48 render_pass, content_bounds(), shared_quad_state, append_quads_data); 47 render_pass, content_bounds(), shared_quad_state, append_quads_data);
49 48
50 if (surface_id_.is_null()) 49 if (surface_id_.is_null())
51 return; 50 return;
52 51
53 gfx::Rect quad_rect(content_bounds()); 52 gfx::Rect quad_rect(content_bounds());
54 gfx::Rect visible_quad_rect = 53 gfx::Rect visible_quad_rect =
55 occlusion_in_content_space.GetUnoccludedContentRect(quad_rect); 54 draw_properties().occlusion_in_content_space.GetUnoccludedContentRect(
55 quad_rect);
56 if (visible_quad_rect.IsEmpty()) 56 if (visible_quad_rect.IsEmpty())
57 return; 57 return;
58 SurfaceDrawQuad* quad = 58 SurfaceDrawQuad* quad =
59 render_pass->CreateAndAppendDrawQuad<SurfaceDrawQuad>(); 59 render_pass->CreateAndAppendDrawQuad<SurfaceDrawQuad>();
60 quad->SetNew(shared_quad_state, quad_rect, visible_quad_rect, surface_id_); 60 quad->SetNew(shared_quad_state, quad_rect, visible_quad_rect, surface_id_);
61 } 61 }
62 62
63 void SurfaceLayerImpl::GetDebugBorderProperties(SkColor* color, 63 void SurfaceLayerImpl::GetDebugBorderProperties(SkColor* color,
64 float* width) const { 64 float* width) const {
65 *color = DebugColors::SurfaceLayerBorderColor(); 65 *color = DebugColors::SurfaceLayerBorderColor();
66 *width = DebugColors::SurfaceLayerBorderWidth(layer_tree_impl()); 66 *width = DebugColors::SurfaceLayerBorderWidth(layer_tree_impl());
67 } 67 }
68 68
69 void SurfaceLayerImpl::AsValueInto(base::debug::TracedValue* dict) const { 69 void SurfaceLayerImpl::AsValueInto(base::trace_event::TracedValue* dict) const {
70 LayerImpl::AsValueInto(dict); 70 LayerImpl::AsValueInto(dict);
71 dict->SetInteger("surface_id", surface_id_.id); 71 dict->SetInteger("surface_id", surface_id_.id);
72 } 72 }
73 73
74 const char* SurfaceLayerImpl::LayerTypeAsString() const { 74 const char* SurfaceLayerImpl::LayerTypeAsString() const {
75 return "cc::SurfaceLayerImpl"; 75 return "cc::SurfaceLayerImpl";
76 } 76 }
77 77
78 } // namespace cc 78 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/surface_layer_impl.h ('k') | cc/layers/texture_layer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698