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

Unified Diff: cc/layers/picture_layer.cc

Issue 732423002: Update from chromium https://crrev.com/304586 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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 5d45caed48099c77a8f232e8ac0dfe9d770e2f72..029e99d5e6611f7e91b0bc5a05470e6869502896 100644
--- a/cc/layers/picture_layer.cc
+++ b/cc/layers/picture_layer.cc
@@ -23,7 +23,14 @@ PictureLayer::PictureLayer(ContentLayerClient* client)
recording_source_(new PicturePile),
instrumentation_object_tracker_(id()),
update_source_frame_number_(-1),
- can_use_lcd_text_last_frame_(can_use_lcd_text()) {
+ can_use_lcd_text_last_frame_(can_use_lcd_text()),
+ is_mask_(false) {
+}
+
+PictureLayer::PictureLayer(ContentLayerClient* client,
+ scoped_ptr<RecordingSource> source)
+ : PictureLayer(client) {
+ recording_source_ = source.Pass();
}
PictureLayer::~PictureLayer() {
@@ -60,13 +67,18 @@ void PictureLayer::PushPropertiesTo(LayerImpl* base_layer) {
// See PictureLayerImpl::PushPropertiesTo for more details.
layer_impl->invalidation_.Clear();
layer_impl->invalidation_.Swap(&recording_invalidation_);
- layer_impl->UpdateRasterSource(recording_source_->CreateRasterSource());
+ layer_impl->set_is_mask(is_mask_);
+ scoped_refptr<RasterSource> raster_source =
+ recording_source_->CreateRasterSource();
+ raster_source->SetBackgoundColor(SafeOpaqueBackgroundColor());
+ raster_source->SetRequiresClear(!contents_opaque() &&
+ !client_->FillsBoundsCompletely());
+ layer_impl->UpdateRasterSource(raster_source);
}
void PictureLayer::SetLayerTreeHost(LayerTreeHost* host) {
Layer::SetLayerTreeHost(host);
if (host) {
- // TODO(hendrikw): Perhaps use and initialization function to do this work.
recording_source_->SetMinContentsScale(
host->settings().minimum_contents_scale);
recording_source_->SetTileGridSize(host->settings().default_tile_grid_size);
@@ -129,10 +141,8 @@ bool PictureLayer::Update(ResourceUpdateQueue* queue,
// for them.
DCHECK(client_);
updated |= recording_source_->UpdateAndExpandInvalidation(
- client_, &recording_invalidation_, SafeOpaqueBackgroundColor(),
- contents_opaque(), client_->FillsBoundsCompletely(), layer_size,
- visible_layer_rect, update_source_frame_number_,
- Picture::RECORD_NORMALLY);
+ client_, &recording_invalidation_, layer_size, visible_layer_rect,
+ update_source_frame_number_, Picture::RECORD_NORMALLY);
last_updated_visible_content_rect_ = visible_content_rect();
if (updated) {
@@ -147,7 +157,7 @@ bool PictureLayer::Update(ResourceUpdateQueue* queue,
}
void PictureLayer::SetIsMask(bool is_mask) {
- recording_source_->SetIsMask(is_mask);
+ is_mask_ = is_mask;
}
bool PictureLayer::SupportsLCDText() const {
« 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