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

Unified Diff: cc/trees/layer_tree_host_pixeltest_masks.cc

Issue 2828353003: Determine mask UVs based on texture size (Closed)
Patch Set: small fix Created 3 years, 8 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/trees/layer_tree_host_pixeltest_masks.cc
diff --git a/cc/trees/layer_tree_host_pixeltest_masks.cc b/cc/trees/layer_tree_host_pixeltest_masks.cc
index eed99f6a625e026151c71b62a9767b34c683bc5e..583df67350ac788f8d82e86babfc698c729736a6 100644
--- a/cc/trees/layer_tree_host_pixeltest_masks.cc
+++ b/cc/trees/layer_tree_host_pixeltest_masks.cc
@@ -148,6 +148,34 @@ TEST_P(LayerTreeHostMasksPixelTest, MaskOfClippedLayer) {
base::FilePath(FILE_PATH_LITERAL("mask_of_clipped_layer.png")));
}
+TEST_P(LayerTreeHostMasksPixelTest, MaskOfLargerLayer) {
+ scoped_refptr<SolidColorLayer> background =
+ CreateSolidColorLayer(gfx::Rect(100, 100), SK_ColorWHITE);
+
+ scoped_refptr<SolidColorLayer> green = CreateSolidColorLayerWithBorder(
+ gfx::Rect(0, 0, 100, 100), kCSSGreen, 1, SK_ColorBLACK);
+ background->AddChild(green);
+
+ gfx::Size mask_bounds(40, 40);
enne (OOO) 2017/05/02 21:31:37 Feel free to take or leave this suggestion, but if
ericrk 2017/05/04 19:23:53 Per discussion, doesn't quite work. Added fuzzy co
+ MaskContentLayerClient client(mask_bounds);
+ scoped_refptr<PictureLayer> mask = PictureLayer::Create(&client);
+ mask->SetBounds(mask_bounds);
+ mask->SetIsDrawable(true);
+ mask->SetLayerMaskType(Layer::LayerMaskType::SINGLE_TEXTURE_MASK);
sunxd 2017/05/03 15:14:13 I made a recent change that makes pixeltest tests
ericrk 2017/05/04 19:23:53 done. Thanks!
+ green->SetMaskLayer(mask.get());
+
+ if (raster_buffer_provider_type_ == RASTER_BUFFER_PROVIDER_TYPE_BITMAP) {
+ // Bitmap produces a sharper (but equivalent sized) mask.
+ RunPixelResourceTest(
+ background,
+ base::FilePath(FILE_PATH_LITERAL("mask_of_larger_layer_bitmap.png")));
+ } else {
+ RunPixelResourceTest(
+ background,
+ base::FilePath(FILE_PATH_LITERAL("mask_of_larger_layer.png")));
+ }
+}
+
class CheckerContentLayerClient : public ContentLayerClient {
public:
CheckerContentLayerClient(const gfx::Size& bounds,

Powered by Google App Engine
This is Rietveld 408576698