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

Unified Diff: cc/layers/picture_layer.cc

Issue 2688673003: cc: Distinguish single texture mask from normal masks (Closed)
Patch Set: Created 3 years, 10 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
Index: cc/layers/picture_layer.cc
diff --git a/cc/layers/picture_layer.cc b/cc/layers/picture_layer.cc
index ca425afa286214e72222a29976196b0f6d98c75c..a8c240ffb29d6a9b9c225f09eed94885f72e3ce2 100644
--- a/cc/layers/picture_layer.cc
+++ b/cc/layers/picture_layer.cc
@@ -27,7 +27,8 @@ scoped_refptr<PictureLayer> PictureLayer::Create(ContentLayerClient* client) {
PictureLayer::PictureLayer(ContentLayerClient* client)
: instrumentation_object_tracker_(id()),
update_source_frame_number_(-1),
- is_mask_(false) {
+ is_mask_(false),
+ is_single_texture_mask_(false) {
picture_layer_inputs_.client = client;
}
@@ -42,7 +43,8 @@ PictureLayer::~PictureLayer() {
std::unique_ptr<LayerImpl> PictureLayer::CreateLayerImpl(
LayerTreeImpl* tree_impl) {
- return PictureLayerImpl::Create(tree_impl, id(), is_mask_);
+ return PictureLayerImpl::Create(tree_impl, id(), is_mask_,
+ is_single_texture_mask_);
}
void PictureLayer::PushPropertiesTo(LayerImpl* base_layer) {
@@ -51,6 +53,7 @@ void PictureLayer::PushPropertiesTo(LayerImpl* base_layer) {
PictureLayerImpl* layer_impl = static_cast<PictureLayerImpl*>(base_layer);
// TODO(danakj): Make is_mask_ a constructor parameter for PictureLayer.
DCHECK_EQ(layer_impl->is_mask(), is_mask_);
+ DCHECK_EQ(layer_impl->is_single_texture_mask(), is_single_texture_mask_);
DropRecordingSourceContentIfInvalid();
layer_impl->SetNearestNeighbor(picture_layer_inputs_.nearest_neighbor);
@@ -141,6 +144,10 @@ void PictureLayer::SetIsMask(bool is_mask) {
is_mask_ = is_mask;
}
+void PictureLayer::SetIsSingleTextureMask(bool is_single_texture_mask) {
+ is_single_texture_mask_ = is_single_texture_mask;
+}
+
sk_sp<SkPicture> PictureLayer::GetPicture() const {
// We could either flatten the RecordingSource into a single SkPicture, or
// paint a fresh one depending on what we intend to do with it. For now we

Powered by Google App Engine
This is Rietveld 408576698