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

Side by Side Diff: cc/layers/tiled_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 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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/tiled_layer_impl.h" 5 #include "cc/layers/tiled_layer_impl.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/debug/trace_event_argument.h" 8 #include "base/debug/trace_event_argument.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "cc/base/math_util.h" 10 #include "cc/base/math_util.h"
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 visible_tile_rect, 197 visible_tile_rect,
198 border_color, 198 border_color,
199 border_width); 199 border_width);
200 } 200 }
201 } 201 }
202 } 202 }
203 203
204 if (skips_draw_) 204 if (skips_draw_)
205 return; 205 return;
206 206
207 Occlusion occlusion =
208 occlusion_tracker.GetCurrentOcclusionForLayer(draw_transform());
207 for (int j = top; j <= bottom; ++j) { 209 for (int j = top; j <= bottom; ++j) {
208 for (int i = left; i <= right; ++i) { 210 for (int i = left; i <= right; ++i) {
209 DrawableTile* tile = TileAt(i, j); 211 DrawableTile* tile = TileAt(i, j);
210 gfx::Rect tile_rect = tiler_->tile_bounds(i, j); 212 gfx::Rect tile_rect = tiler_->tile_bounds(i, j);
211 gfx::Rect display_rect = tile_rect; 213 gfx::Rect display_rect = tile_rect;
212 tile_rect.Intersect(content_rect); 214 tile_rect.Intersect(content_rect);
213 215
214 // Skip empty tiles. 216 // Skip empty tiles.
215 if (tile_rect.IsEmpty()) 217 if (tile_rect.IsEmpty())
216 continue; 218 continue;
217 219
218 gfx::Rect visible_tile_rect = 220 gfx::Rect visible_tile_rect =
219 occlusion_tracker.UnoccludedContentRect(tile_rect, draw_transform()); 221 occlusion.GetUnoccludedContentRect(tile_rect);
220 if (visible_tile_rect.IsEmpty()) 222 if (visible_tile_rect.IsEmpty())
221 continue; 223 continue;
222 224
223 if (!tile || !tile->resource_id()) { 225 if (!tile || !tile->resource_id()) {
224 SkColor checker_color; 226 SkColor checker_color;
225 if (ShowDebugBorders()) { 227 if (ShowDebugBorders()) {
226 checker_color = 228 checker_color =
227 tile ? DebugColors::InvalidatedTileCheckerboardColor() 229 tile ? DebugColors::InvalidatedTileCheckerboardColor()
228 : DebugColors::EvictedTileCheckerboardColor(); 230 : DebugColors::EvictedTileCheckerboardColor();
229 } else { 231 } else {
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 306
305 void TiledLayerImpl::ReleaseResources() { 307 void TiledLayerImpl::ReleaseResources() {
306 tiler_->reset(); 308 tiler_->reset();
307 } 309 }
308 310
309 const char* TiledLayerImpl::LayerTypeAsString() const { 311 const char* TiledLayerImpl::LayerTypeAsString() const {
310 return "cc::TiledLayerImpl"; 312 return "cc::TiledLayerImpl";
311 } 313 }
312 314
313 } // namespace cc 315 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698