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

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

Issue 1077033004: cc: Make DisplayItemList::Append replay into an SkPicture (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 5 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 unified diff | Download patch
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 "build/build_config.h" 5 #include "build/build_config.h"
6 #include "cc/layers/content_layer_client.h" 6 #include "cc/layers/content_layer_client.h"
7 #include "cc/layers/picture_image_layer.h" 7 #include "cc/layers/picture_image_layer.h"
8 #include "cc/layers/picture_layer.h" 8 #include "cc/layers/picture_layer.h"
9 #include "cc/layers/solid_color_layer.h" 9 #include "cc/layers/solid_color_layer.h"
10 #include "cc/test/layer_tree_pixel_resource_test.h" 10 #include "cc/test/layer_tree_pixel_resource_test.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 inset_rect.width(), inset_rect.height()), 43 inset_rect.width(), inset_rect.height()),
44 paint); 44 paint);
45 inset_rect.Inset(3, 3, 2, 2); 45 inset_rect.Inset(3, 3, 2, 2);
46 } 46 }
47 } 47 }
48 48
49 scoped_refptr<DisplayItemList> PaintContentsToDisplayList( 49 scoped_refptr<DisplayItemList> PaintContentsToDisplayList(
50 const gfx::Rect& clip, 50 const gfx::Rect& clip,
51 PaintingControlSetting picture_control) override { 51 PaintingControlSetting picture_control) override {
52 NOTIMPLEMENTED(); 52 NOTIMPLEMENTED();
53 return DisplayItemList::Create(); 53 return DisplayItemList::Create(clip);
54 } 54 }
55 55
56 private: 56 private:
57 gfx::Size bounds_; 57 gfx::Size bounds_;
58 }; 58 };
59 59
60 TEST_P(LayerTreeHostMasksPixelTest, MaskOfLayer) { 60 TEST_P(LayerTreeHostMasksPixelTest, MaskOfLayer) {
61 scoped_refptr<SolidColorLayer> background = CreateSolidColorLayer( 61 scoped_refptr<SolidColorLayer> background = CreateSolidColorLayer(
62 gfx::Rect(100, 100), SK_ColorWHITE); 62 gfx::Rect(100, 100), SK_ColorWHITE);
63 63
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 } else { 300 } else {
301 for (int i = 4; i < bounds_.height(); i += 16) { 301 for (int i = 4; i < bounds_.height(); i += 16) {
302 canvas->drawLine(0, i, bounds_.width(), i, paint); 302 canvas->drawLine(0, i, bounds_.width(), i, paint);
303 } 303 }
304 } 304 }
305 } 305 }
306 scoped_refptr<DisplayItemList> PaintContentsToDisplayList( 306 scoped_refptr<DisplayItemList> PaintContentsToDisplayList(
307 const gfx::Rect& clip, 307 const gfx::Rect& clip,
308 PaintingControlSetting picture_control) override { 308 PaintingControlSetting picture_control) override {
309 NOTIMPLEMENTED(); 309 NOTIMPLEMENTED();
310 return DisplayItemList::Create(); 310 return DisplayItemList::Create(clip);
311 } 311 }
312 312
313 private: 313 private:
314 gfx::Size bounds_; 314 gfx::Size bounds_;
315 SkColor color_; 315 SkColor color_;
316 bool vertical_; 316 bool vertical_;
317 }; 317 };
318 318
319 class CircleContentLayerClient : public ContentLayerClient { 319 class CircleContentLayerClient : public ContentLayerClient {
320 public: 320 public:
(...skipping 10 matching lines...) Expand all
331 canvas->clear(SK_ColorTRANSPARENT); 331 canvas->clear(SK_ColorTRANSPARENT);
332 canvas->drawCircle(bounds_.width() / 2, 332 canvas->drawCircle(bounds_.width() / 2,
333 bounds_.height() / 2, 333 bounds_.height() / 2,
334 bounds_.width() / 4, 334 bounds_.width() / 4,
335 paint); 335 paint);
336 } 336 }
337 scoped_refptr<DisplayItemList> PaintContentsToDisplayList( 337 scoped_refptr<DisplayItemList> PaintContentsToDisplayList(
338 const gfx::Rect& clip, 338 const gfx::Rect& clip,
339 PaintingControlSetting picture_control) override { 339 PaintingControlSetting picture_control) override {
340 NOTIMPLEMENTED(); 340 NOTIMPLEMENTED();
341 return DisplayItemList::Create(); 341 return DisplayItemList::Create(clip);
342 } 342 }
343 343
344 private: 344 private:
345 gfx::Size bounds_; 345 gfx::Size bounds_;
346 }; 346 };
347 347
348 using LayerTreeHostMasksForBackgroundFiltersPixelTest = 348 using LayerTreeHostMasksForBackgroundFiltersPixelTest =
349 ParameterizedPixelResourceTest; 349 ParameterizedPixelResourceTest;
350 350
351 INSTANTIATE_TEST_CASE_P( 351 INSTANTIATE_TEST_CASE_P(
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
456 456
457 RunPixelResourceTest(background, 457 RunPixelResourceTest(background,
458 base::FilePath( 458 base::FilePath(
459 FILE_PATH_LITERAL("mask_of_layer_with_blend.png"))); 459 FILE_PATH_LITERAL("mask_of_layer_with_blend.png")));
460 } 460 }
461 461
462 } // namespace 462 } // namespace
463 } // namespace cc 463 } // namespace cc
464 464
465 #endif // !defined(OS_ANDROID) 465 #endif // !defined(OS_ANDROID)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698