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

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

Issue 362073002: cc: Remove all traces of SkPicture cloning. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 4 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 | « cc/resources/picture_layer_tiling.cc ('k') | cc/resources/picture_pile_base.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 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 "cc/resources/picture_pile.h" 5 #include "cc/resources/picture_pile.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 return updated; 338 return updated;
339 339
340 for (std::vector<gfx::Rect>::iterator it = record_rects.begin(); 340 for (std::vector<gfx::Rect>::iterator it = record_rects.begin();
341 it != record_rects.end(); 341 it != record_rects.end();
342 it++) { 342 it++) {
343 gfx::Rect record_rect = *it; 343 gfx::Rect record_rect = *it;
344 record_rect = PadRect(record_rect); 344 record_rect = PadRect(record_rect);
345 345
346 int repeat_count = std::max(1, slow_down_raster_scale_factor_for_debug_); 346 int repeat_count = std::max(1, slow_down_raster_scale_factor_for_debug_);
347 scoped_refptr<Picture> picture; 347 scoped_refptr<Picture> picture;
348 int num_raster_threads = RasterWorkerPool::GetNumRasterThreads();
349 348
350 // Note: Currently, gathering of pixel refs when using a single 349 // Note: Currently, gathering of pixel refs when using a single
351 // raster thread doesn't provide any benefit. This might change 350 // raster thread doesn't provide any benefit. This might change
352 // in the future but we avoid it for now to reduce the cost of 351 // in the future but we avoid it for now to reduce the cost of
353 // Picture::Create. 352 // Picture::Create.
354 bool gather_pixel_refs = num_raster_threads > 1; 353 bool gather_pixel_refs = RasterWorkerPool::GetNumRasterThreads() > 1;
355 354
356 { 355 {
357 base::TimeDelta best_duration = base::TimeDelta::Max(); 356 base::TimeDelta best_duration = base::TimeDelta::Max();
358 for (int i = 0; i < repeat_count; i++) { 357 for (int i = 0; i < repeat_count; i++) {
359 base::TimeTicks start_time = stats_instrumentation->StartRecording(); 358 base::TimeTicks start_time = stats_instrumentation->StartRecording();
360 picture = Picture::Create(record_rect, 359 picture = Picture::Create(record_rect,
361 painter, 360 painter,
362 tile_grid_info_, 361 tile_grid_info_,
363 gather_pixel_refs, 362 gather_pixel_refs,
364 num_raster_threads,
365 recording_mode); 363 recording_mode);
366 // Note the '&&' with previous is-suitable state. 364 // Note the '&&' with previous is-suitable state.
367 // This means that once a picture-pile becomes unsuitable for gpu 365 // This means that once a picture-pile becomes unsuitable for gpu
368 // rasterization due to some content, it will continue to be unsuitable 366 // rasterization due to some content, it will continue to be unsuitable
369 // even if that content is replaced by gpu-friendly content. 367 // even if that content is replaced by gpu-friendly content.
370 // This is an optimization to avoid iterating though all pictures in 368 // This is an optimization to avoid iterating though all pictures in
371 // the pile after each invalidation. 369 // the pile after each invalidation.
372 is_suitable_for_gpu_rasterization_ &= 370 is_suitable_for_gpu_rasterization_ &=
373 picture->IsSuitableForGpuRasterization(); 371 picture->IsSuitableForGpuRasterization();
374 has_text_ |= picture->HasText(); 372 has_text_ |= picture->HasText();
(...skipping 28 matching lines...) Expand all
403 } 401 }
404 402
405 void PicturePile::SetEmptyBounds() { 403 void PicturePile::SetEmptyBounds() {
406 tiling_.SetTilingSize(gfx::Size()); 404 tiling_.SetTilingSize(gfx::Size());
407 picture_map_.clear(); 405 picture_map_.clear();
408 has_any_recordings_ = false; 406 has_any_recordings_ = false;
409 recorded_viewport_ = gfx::Rect(); 407 recorded_viewport_ = gfx::Rect();
410 } 408 }
411 409
412 } // namespace cc 410 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/picture_layer_tiling.cc ('k') | cc/resources/picture_pile_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698