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

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

Issue 1083683003: Speculative revert by sheriff (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed an unrelated commit that had accidentally slipped in. 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
« no previous file with comments | « cc/trees/layer_tree_host_common_unittest.cc ('k') | cc/trees/layer_tree_host_unittest.cc » ('j') | 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 "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 28 matching lines...) Expand all
39 while (!inset_rect.IsEmpty()) { 39 while (!inset_rect.IsEmpty()) {
40 inset_rect.Inset(3, 3, 2, 2); 40 inset_rect.Inset(3, 3, 2, 2);
41 canvas->drawRect( 41 canvas->drawRect(
42 SkRect::MakeXYWH(inset_rect.x(), inset_rect.y(), 42 SkRect::MakeXYWH(inset_rect.x(), inset_rect.y(),
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 void PaintContentsToDisplayList( 49 scoped_refptr<DisplayItemList> PaintContentsToDisplayList(
50 DisplayItemList* display_list,
51 const gfx::Rect& clip, 50 const gfx::Rect& clip,
52 PaintingControlSetting picture_control) override { 51 PaintingControlSetting picture_control) override {
53 NOTIMPLEMENTED(); 52 NOTIMPLEMENTED();
53 return DisplayItemList::Create();
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 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 if (vertical_) { 296 if (vertical_) {
297 for (int i = 4; i < bounds_.width(); i += 16) { 297 for (int i = 4; i < bounds_.width(); i += 16) {
298 canvas->drawLine(i, 0, i, bounds_.height(), paint); 298 canvas->drawLine(i, 0, i, bounds_.height(), paint);
299 } 299 }
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 void PaintContentsToDisplayList( 306 scoped_refptr<DisplayItemList> PaintContentsToDisplayList(
307 DisplayItemList* display_list,
308 const gfx::Rect& clip, 307 const gfx::Rect& clip,
309 PaintingControlSetting picture_control) override { 308 PaintingControlSetting picture_control) override {
310 NOTIMPLEMENTED(); 309 NOTIMPLEMENTED();
310 return DisplayItemList::Create();
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:
321 explicit CircleContentLayerClient(const gfx::Size& bounds) 321 explicit CircleContentLayerClient(const gfx::Size& bounds)
322 : bounds_(bounds) {} 322 : bounds_(bounds) {}
323 ~CircleContentLayerClient() override {} 323 ~CircleContentLayerClient() override {}
324 bool FillsBoundsCompletely() const override { return false; } 324 bool FillsBoundsCompletely() const override { return false; }
325 void PaintContents(SkCanvas* canvas, 325 void PaintContents(SkCanvas* canvas,
326 const gfx::Rect& rect, 326 const gfx::Rect& rect,
327 PaintingControlSetting picture_control) override { 327 PaintingControlSetting picture_control) override {
328 SkPaint paint; 328 SkPaint paint;
329 paint.setStyle(SkPaint::kFill_Style); 329 paint.setStyle(SkPaint::kFill_Style);
330 paint.setColor(SK_ColorWHITE); 330 paint.setColor(SK_ColorWHITE);
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 void PaintContentsToDisplayList( 337 scoped_refptr<DisplayItemList> PaintContentsToDisplayList(
338 DisplayItemList* display_list,
339 const gfx::Rect& clip, 338 const gfx::Rect& clip,
340 PaintingControlSetting picture_control) override { 339 PaintingControlSetting picture_control) override {
341 NOTIMPLEMENTED(); 340 NOTIMPLEMENTED();
341 return DisplayItemList::Create();
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
« no previous file with comments | « cc/trees/layer_tree_host_common_unittest.cc ('k') | cc/trees/layer_tree_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698