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

Side by Side Diff: cc/resources/picture_pile_impl.cc

Issue 213093003: cc: Skip analysis for narrow layers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: update Created 6 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | cc/resources/tile_manager.cc » ('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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 <algorithm> 5 #include <algorithm>
6 #include <limits> 6 #include <limits>
7 7
8 #include "base/debug/trace_event.h" 8 #include "base/debug/trace_event.h"
9 #include "cc/base/region.h" 9 #include "cc/base/region.h"
10 #include "cc/debug/debug_colors.h" 10 #include "cc/debug/debug_colors.h"
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 layer_rect.Intersect(gfx::Rect(tiling_.total_size())); 369 layer_rect.Intersect(gfx::Rect(tiling_.total_size()));
370 370
371 skia::AnalysisCanvas canvas(layer_rect.width(), layer_rect.height()); 371 skia::AnalysisCanvas canvas(layer_rect.width(), layer_rect.height());
372 372
373 RasterForAnalysis(&canvas, layer_rect, 1.0f, stats_instrumentation); 373 RasterForAnalysis(&canvas, layer_rect, 1.0f, stats_instrumentation);
374 374
375 analysis->is_solid_color = canvas.GetColorIfSolid(&analysis->solid_color); 375 analysis->is_solid_color = canvas.GetColorIfSolid(&analysis->solid_color);
376 analysis->has_text = canvas.HasText(); 376 analysis->has_text = canvas.HasText();
377 } 377 }
378 378
379 PicturePileImpl::Analysis::Analysis() 379 // Since there are situations when we can skip analysis, the variables have to
380 : is_solid_color(false), 380 // be set to their safest values. That is, we have to assume that the tile is
381 has_text(false) { 381 // not solid color. As well, we have to assume that the tile has text so we
382 } 382 // don't early out incorrectly.
383 PicturePileImpl::Analysis::Analysis() : is_solid_color(false), has_text(true) {}
383 384
384 PicturePileImpl::Analysis::~Analysis() { 385 PicturePileImpl::Analysis::~Analysis() {
385 } 386 }
386 387
387 PicturePileImpl::PixelRefIterator::PixelRefIterator( 388 PicturePileImpl::PixelRefIterator::PixelRefIterator(
388 const gfx::Rect& content_rect, 389 const gfx::Rect& content_rect,
389 float contents_scale, 390 float contents_scale,
390 const PicturePileImpl* picture_pile) 391 const PicturePileImpl* picture_pile)
391 : picture_pile_(picture_pile), 392 : picture_pile_(picture_pile),
392 layer_rect_( 393 layer_rect_(
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 ++it) { 443 ++it) {
443 Picture* picture = it->second.GetPicture(); 444 Picture* picture = it->second.GetPicture();
444 if (picture && (processed_pictures.count(picture) == 0)) { 445 if (picture && (processed_pictures.count(picture) == 0)) {
445 picture->EmitTraceSnapshot(); 446 picture->EmitTraceSnapshot();
446 processed_pictures.insert(picture); 447 processed_pictures.insert(picture);
447 } 448 }
448 } 449 }
449 } 450 }
450 451
451 } // namespace cc 452 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/resources/tile_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698