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

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

Issue 576173003: cc: Move UnoccludedContentRect to Occlusion. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/ui_resource_layer_impl.h" 5 #include "cc/layers/ui_resource_layer_impl.h"
6 6
7 #include "base/strings/stringprintf.h" 7 #include "base/strings/stringprintf.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "cc/base/math_util.h" 9 #include "cc/base/math_util.h"
10 #include "cc/quads/texture_draw_quad.h" 10 #include "cc/quads/texture_draw_quad.h"
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 static const bool flipped = false; 114 static const bool flipped = false;
115 static const bool premultiplied_alpha = true; 115 static const bool premultiplied_alpha = true;
116 116
117 DCHECK(!bounds().IsEmpty()); 117 DCHECK(!bounds().IsEmpty());
118 118
119 bool opaque = layer_tree_impl()->IsUIResourceOpaque(ui_resource_id_) || 119 bool opaque = layer_tree_impl()->IsUIResourceOpaque(ui_resource_id_) ||
120 contents_opaque(); 120 contents_opaque();
121 121
122 gfx::Rect quad_rect(bounds()); 122 gfx::Rect quad_rect(bounds());
123 gfx::Rect opaque_rect(opaque ? quad_rect : gfx::Rect()); 123 gfx::Rect opaque_rect(opaque ? quad_rect : gfx::Rect());
124 gfx::Rect visible_quad_rect = occlusion_tracker.UnoccludedContentRect( 124 gfx::Rect visible_quad_rect =
125 quad_rect, draw_properties().target_space_transform); 125 occlusion_tracker.GetCurrentOcclusionForLayer(
126 draw_properties().target_space_transform)
127 .GetUnoccludedContentRect(quad_rect);
126 if (visible_quad_rect.IsEmpty()) 128 if (visible_quad_rect.IsEmpty())
127 return; 129 return;
128 130
129 TextureDrawQuad* quad = 131 TextureDrawQuad* quad =
130 render_pass->CreateAndAppendDrawQuad<TextureDrawQuad>(); 132 render_pass->CreateAndAppendDrawQuad<TextureDrawQuad>();
131 quad->SetNew(shared_quad_state, 133 quad->SetNew(shared_quad_state,
132 quad_rect, 134 quad_rect,
133 opaque_rect, 135 opaque_rect,
134 visible_quad_rect, 136 visible_quad_rect,
135 resource, 137 resource,
(...skipping 21 matching lines...) Expand all
157 list->AppendDouble(vertex_opacity_[3]); 159 list->AppendDouble(vertex_opacity_[3]);
158 result->Set("VertexOpacity", list); 160 result->Set("VertexOpacity", list);
159 161
160 result->Set("UVTopLeft", MathUtil::AsValue(uv_top_left_).release()); 162 result->Set("UVTopLeft", MathUtil::AsValue(uv_top_left_).release());
161 result->Set("UVBottomRight", MathUtil::AsValue(uv_bottom_right_).release()); 163 result->Set("UVBottomRight", MathUtil::AsValue(uv_bottom_right_).release());
162 164
163 return result; 165 return result;
164 } 166 }
165 167
166 } // namespace cc 168 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698