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

Unified Diff: cc/layers/picture_layer.cc

Issue 669813003: Update from chromium https://crrev.com/301725/ (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 2 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/layers/picture_layer.h ('k') | cc/layers/picture_layer_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/picture_layer.cc
diff --git a/cc/layers/picture_layer.cc b/cc/layers/picture_layer.cc
index 4d44f00b774a3d7ee1b57f5c7dcbcaeb3cdbe2fd..6e5ba79bc4bb3abb93053dcb033fdbe9b662182c 100644
--- a/cc/layers/picture_layer.cc
+++ b/cc/layers/picture_layer.cc
@@ -19,7 +19,6 @@ scoped_refptr<PictureLayer> PictureLayer::Create(ContentLayerClient* client) {
PictureLayer::PictureLayer(ContentLayerClient* client)
: client_(client),
- pile_(make_scoped_refptr(new PicturePile())),
instrumentation_object_tracker_(id()),
update_source_frame_number_(-1),
can_use_lcd_text_last_frame_(can_use_lcd_text()) {
@@ -40,29 +39,29 @@ void PictureLayer::PushPropertiesTo(LayerImpl* base_layer) {
// Update may not get called for an empty layer, so resize here instead.
// Using layer_impl because either bounds() or paint_properties().bounds
// may disagree and either one could have been pushed to layer_impl.
- pile_->SetEmptyBounds();
+ pile_.SetEmptyBounds();
} else {
// If update called, then pile size must match bounds pushed to impl layer.
DCHECK_IMPLIES(
update_source_frame_number_ == layer_tree_host()->source_frame_number(),
- layer_impl->bounds().ToString() == pile_->tiling_size().ToString());
+ layer_impl->bounds().ToString() == pile_.tiling_size().ToString());
}
// Unlike other properties, invalidation must always be set on layer_impl.
// See PictureLayerImpl::PushPropertiesTo for more details.
layer_impl->invalidation_.Clear();
layer_impl->invalidation_.Swap(&pile_invalidation_);
- layer_impl->pile_ = PicturePileImpl::CreateFromOther(pile_.get());
+ layer_impl->pile_ = PicturePileImpl::CreateFromOther(&pile_);
}
void PictureLayer::SetLayerTreeHost(LayerTreeHost* host) {
Layer::SetLayerTreeHost(host);
if (host) {
- pile_->SetMinContentsScale(host->settings().minimum_contents_scale);
- pile_->SetTileGridSize(host->settings().default_tile_grid_size);
- pile_->set_slow_down_raster_scale_factor(
+ pile_.SetMinContentsScale(host->settings().minimum_contents_scale);
+ pile_.SetTileGridSize(host->settings().default_tile_grid_size);
+ pile_.set_slow_down_raster_scale_factor(
host->debug_state().slow_down_raster_scale_factor);
- pile_->set_show_debug_picture_borders(
+ pile_.set_show_debug_picture_borders(
host->debug_state().show_picture_borders);
}
}
@@ -92,7 +91,7 @@ bool PictureLayer::Update(ResourceUpdateQueue* queue,
gfx::Size layer_size = paint_properties().bounds;
if (last_updated_visible_content_rect_ == visible_content_rect() &&
- pile_->tiling_size() == layer_size && pending_invalidation_.IsEmpty()) {
+ pile_.tiling_size() == layer_size && pending_invalidation_.IsEmpty()) {
// Only early out if the visible content rect of this layer hasn't changed.
return updated;
}
@@ -120,16 +119,16 @@ bool PictureLayer::Update(ResourceUpdateQueue* queue,
// for them.
DCHECK(client_);
updated |=
- pile_->UpdateAndExpandInvalidation(client_,
- &pile_invalidation_,
- SafeOpaqueBackgroundColor(),
- contents_opaque(),
- client_->FillsBoundsCompletely(),
- layer_size,
- visible_layer_rect,
- update_source_frame_number_,
- Picture::RECORD_NORMALLY,
- rendering_stats_instrumentation());
+ pile_.UpdateAndExpandInvalidation(client_,
+ &pile_invalidation_,
+ SafeOpaqueBackgroundColor(),
+ contents_opaque(),
+ client_->FillsBoundsCompletely(),
+ layer_size,
+ visible_layer_rect,
+ update_source_frame_number_,
+ Picture::RECORD_NORMALLY,
+ rendering_stats_instrumentation());
last_updated_visible_content_rect_ = visible_content_rect();
if (updated) {
@@ -144,7 +143,7 @@ bool PictureLayer::Update(ResourceUpdateQueue* queue,
}
void PictureLayer::SetIsMask(bool is_mask) {
- pile_->set_is_mask(is_mask);
+ pile_.set_is_mask(is_mask);
}
bool PictureLayer::SupportsLCDText() const {
@@ -180,7 +179,7 @@ skia::RefPtr<SkPicture> PictureLayer::GetPicture() const {
}
bool PictureLayer::IsSuitableForGpuRasterization() const {
- return pile_->is_suitable_for_gpu_rasterization();
+ return pile_.is_suitable_for_gpu_rasterization();
}
void PictureLayer::ClearClient() {
« no previous file with comments | « cc/layers/picture_layer.h ('k') | cc/layers/picture_layer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698