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

Side by Side Diff: cc/trees/layer_tree_host_pixeltest_masks.cc

Issue 2075873002: Support general raster matrix for RasterSource and DisplayItemList (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix a bug in PrepareForPlaybackToCanvas and fix cc_unittests Created 4 years, 6 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 unified diff | Download patch
« cc/playback/raster_source.cc ('K') | « cc/test/fake_raster_source.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <stddef.h> 5 #include <stddef.h>
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 #include "cc/layers/content_layer_client.h" 8 #include "cc/layers/content_layer_client.h"
9 #include "cc/layers/picture_image_layer.h" 9 #include "cc/layers/picture_image_layer.h"
10 #include "cc/layers/picture_layer.h" 10 #include "cc/layers/picture_layer.h"
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 mask->SetIsMask(true); 103 mask->SetIsMask(true);
104 mask->SetBounds(mask_bounds); 104 mask->SetBounds(mask_bounds);
105 105
106 sk_sp<SkSurface> surface = SkSurface::MakeRasterN32Premul(200, 200); 106 sk_sp<SkSurface> surface = SkSurface::MakeRasterN32Premul(200, 200);
107 SkCanvas* canvas = surface->getCanvas(); 107 SkCanvas* canvas = surface->getCanvas();
108 canvas->scale(SkIntToScalar(4), SkIntToScalar(4)); 108 canvas->scale(SkIntToScalar(4), SkIntToScalar(4));
109 MaskContentLayerClient client(mask_bounds); 109 MaskContentLayerClient client(mask_bounds);
110 scoped_refptr<DisplayItemList> mask_display_list = 110 scoped_refptr<DisplayItemList> mask_display_list =
111 client.PaintContentsToDisplayList( 111 client.PaintContentsToDisplayList(
112 ContentLayerClient::PAINTING_BEHAVIOR_NORMAL); 112 ContentLayerClient::PAINTING_BEHAVIOR_NORMAL);
113 mask_display_list->Raster(canvas, nullptr, gfx::Rect(mask_bounds), 1.0f); 113 mask_display_list->Raster(canvas, nullptr);
114 mask->SetImage(surface->makeImageSnapshot()); 114 mask->SetImage(surface->makeImageSnapshot());
115 115
116 scoped_refptr<SolidColorLayer> green = CreateSolidColorLayerWithBorder( 116 scoped_refptr<SolidColorLayer> green = CreateSolidColorLayerWithBorder(
117 gfx::Rect(25, 25, 50, 50), kCSSGreen, 1, SK_ColorBLACK); 117 gfx::Rect(25, 25, 50, 50), kCSSGreen, 1, SK_ColorBLACK);
118 green->SetMaskLayer(mask.get()); 118 green->SetMaskLayer(mask.get());
119 background->AddChild(green); 119 background->AddChild(green);
120 120
121 RunPixelResourceTest( 121 RunPixelResourceTest(
122 background, base::FilePath(FILE_PATH_LITERAL("image_mask_of_layer.png"))); 122 background, base::FilePath(FILE_PATH_LITERAL("image_mask_of_layer.png")));
123 } 123 }
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
518 518
519 RunPixelResourceTest(background, 519 RunPixelResourceTest(background,
520 base::FilePath( 520 base::FilePath(
521 FILE_PATH_LITERAL("mask_of_layer_with_blend.png"))); 521 FILE_PATH_LITERAL("mask_of_layer_with_blend.png")));
522 } 522 }
523 523
524 } // namespace 524 } // namespace
525 } // namespace cc 525 } // namespace cc
526 526
527 #endif // !defined(OS_ANDROID) 527 #endif // !defined(OS_ANDROID)
OLDNEW
« cc/playback/raster_source.cc ('K') | « cc/test/fake_raster_source.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698