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

Unified Diff: cc/layers/render_surface_impl.cc

Issue 2659023003: [cc] Add SkBlendMode::kDstIn support to cc::Layer (Closed)
Patch Set: Created 3 years, 11 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/layer.cc ('k') | cc/output/gl_renderer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/render_surface_impl.cc
diff --git a/cc/layers/render_surface_impl.cc b/cc/layers/render_surface_impl.cc
index 1265e4f0ea0effe7cb5cd413554ba73b9b962c29..d43f72396a12ef37f3c8d5a76dd987a7bf0eef68 100644
--- a/cc/layers/render_surface_impl.cc
+++ b/cc/layers/render_surface_impl.cc
@@ -403,6 +403,12 @@ void RenderSurfaceImpl::AppendQuads(RenderPass* render_pass,
LayerImpl* mask_layer = MaskLayer();
if (mask_layer && mask_layer->DrawsContent() &&
!mask_layer->bounds().IsEmpty()) {
+ // The software renderer applies mask layer and blending in the wrong
enne (OOO) 2017/01/30 18:56:54 Can you explain this restriction a little bit more
trchen 2017/01/30 23:07:06 Let's make a simple example. Assuming we are drawi
+ // order but kDstIn doesn't commute with masking. It is okay to not
+ // support this configuration because kDstIn was introduced to replace
+ // mask layers.
+ DCHECK(BlendMode() != SkBlendMode::kDstIn)
+ << "kDstIn blend mode with mask layer is unsupported.";
mask_layer->GetContentsResourceId(&mask_resource_id, &mask_texture_size);
gfx::SizeF unclipped_mask_target_size = gfx::ScaleSize(
gfx::SizeF(OwningEffectNode()->unscaled_mask_target_size),
« no previous file with comments | « cc/layers/layer.cc ('k') | cc/output/gl_renderer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698