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

Unified Diff: cc/resources/picture_pile.cc

Issue 1028333002: Chromium -> Mojo roll. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/resources/picture_pile.h ('k') | cc/resources/picture_pile_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/picture_pile.cc
diff --git a/cc/resources/picture_pile.cc b/cc/resources/picture_pile.cc
index 04e08010073bfff27c10447f0bf5273ae9de2f47..b5b9c79f08af41cfae352f0e9338651d492ef8b8 100644
--- a/cc/resources/picture_pile.cc
+++ b/cc/resources/picture_pile.cc
@@ -10,7 +10,6 @@
#include "cc/base/region.h"
#include "cc/resources/picture_pile_impl.h"
-#include "cc/resources/tile_task_worker_pool.h"
#include "skia/ext/analysis_canvas.h"
namespace {
@@ -166,6 +165,7 @@ PicturePile::PicturePile(float min_contents_scale,
const gfx::Size& tile_grid_size)
: min_contents_scale_(0),
slow_down_raster_scale_factor_for_debug_(0),
+ gather_pixel_refs_(false),
has_any_recordings_(false),
clear_canvas_with_debug_color_(kDefaultClearCanvasSetting),
requires_clear_(true),
@@ -539,15 +539,9 @@ void PicturePile::CreatePictures(ContentLayerClient* painter,
int repeat_count = std::max(1, slow_down_raster_scale_factor_for_debug_);
scoped_refptr<Picture> picture;
- // Note: Currently, gathering of pixel refs when using a single
- // raster thread doesn't provide any benefit. This might change
- // in the future but we avoid it for now to reduce the cost of
- // Picture::Create.
- bool gather_pixel_refs = TileTaskWorkerPool::GetNumWorkerThreads() > 1;
-
for (int i = 0; i < repeat_count; i++) {
picture = Picture::Create(padded_record_rect, painter, tile_grid_size_,
- gather_pixel_refs, recording_mode);
+ gather_pixel_refs_, recording_mode);
// Note the '&&' with previous is-suitable state.
// This means that once a picture-pile becomes unsuitable for gpu
// rasterization due to some content, it will continue to be unsuitable
@@ -623,6 +617,10 @@ void PicturePile::SetSlowdownRasterScaleFactor(int factor) {
slow_down_raster_scale_factor_for_debug_ = factor;
}
+void PicturePile::SetGatherPixelRefs(bool gather_pixel_refs) {
+ gather_pixel_refs_ = gather_pixel_refs;
+}
+
void PicturePile::SetBackgroundColor(SkColor background_color) {
background_color_ = background_color;
}
« no previous file with comments | « cc/resources/picture_pile.h ('k') | cc/resources/picture_pile_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698