OLD | NEW |
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/playback/display_item_list_settings.h" | 10 #include "cc/playback/display_item_list_settings.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 inset_rect.Inset(3, 3, 2, 2); | 51 inset_rect.Inset(3, 3, 2, 2); |
52 canvas->drawRect( | 52 canvas->drawRect( |
53 SkRect::MakeXYWH(inset_rect.x(), inset_rect.y(), | 53 SkRect::MakeXYWH(inset_rect.x(), inset_rect.y(), |
54 inset_rect.width(), inset_rect.height()), | 54 inset_rect.width(), inset_rect.height()), |
55 paint); | 55 paint); |
56 inset_rect.Inset(3, 3, 2, 2); | 56 inset_rect.Inset(3, 3, 2, 2); |
57 } | 57 } |
58 | 58 |
59 scoped_refptr<DisplayItemList> display_list = | 59 scoped_refptr<DisplayItemList> display_list = |
60 DisplayItemList::Create(PaintableRegion(), DisplayItemListSettings()); | 60 DisplayItemList::Create(PaintableRegion(), DisplayItemListSettings()); |
61 auto* item = display_list->CreateAndAppendItem<DrawingDisplayItem>( | |
62 PaintableRegion()); | |
63 | |
64 skia::RefPtr<SkPicture> picture = | 61 skia::RefPtr<SkPicture> picture = |
65 skia::AdoptRef(recorder.endRecordingAsPicture()); | 62 skia::AdoptRef(recorder.endRecordingAsPicture()); |
66 item->SetNew(std::move(picture)); | 63 display_list->CreateAndAppendItem<DrawingDisplayItem>(PaintableRegion(), |
| 64 std::move(picture)); |
67 | 65 |
68 display_list->Finalize(); | 66 display_list->Finalize(); |
69 return display_list; | 67 return display_list; |
70 } | 68 } |
71 | 69 |
72 private: | 70 private: |
73 gfx::Size bounds_; | 71 gfx::Size bounds_; |
74 }; | 72 }; |
75 | 73 |
76 TEST_P(LayerTreeHostMasksPixelTest, MaskOfLayer) { | 74 TEST_P(LayerTreeHostMasksPixelTest, MaskOfLayer) { |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 canvas->drawLine(i, 0, i, bounds_.height(), paint); | 328 canvas->drawLine(i, 0, i, bounds_.height(), paint); |
331 } | 329 } |
332 } else { | 330 } else { |
333 for (int i = 4; i < bounds_.height(); i += 16) { | 331 for (int i = 4; i < bounds_.height(); i += 16) { |
334 canvas->drawLine(0, i, bounds_.width(), i, paint); | 332 canvas->drawLine(0, i, bounds_.width(), i, paint); |
335 } | 333 } |
336 } | 334 } |
337 | 335 |
338 scoped_refptr<DisplayItemList> display_list = | 336 scoped_refptr<DisplayItemList> display_list = |
339 DisplayItemList::Create(PaintableRegion(), DisplayItemListSettings()); | 337 DisplayItemList::Create(PaintableRegion(), DisplayItemListSettings()); |
340 auto* item = display_list->CreateAndAppendItem<DrawingDisplayItem>( | |
341 PaintableRegion()); | |
342 | |
343 skia::RefPtr<SkPicture> picture = | 338 skia::RefPtr<SkPicture> picture = |
344 skia::AdoptRef(recorder.endRecordingAsPicture()); | 339 skia::AdoptRef(recorder.endRecordingAsPicture()); |
345 item->SetNew(std::move(picture)); | 340 display_list->CreateAndAppendItem<DrawingDisplayItem>(PaintableRegion(), |
| 341 std::move(picture)); |
346 | 342 |
347 display_list->Finalize(); | 343 display_list->Finalize(); |
348 return display_list; | 344 return display_list; |
349 } | 345 } |
350 | 346 |
351 private: | 347 private: |
352 gfx::Size bounds_; | 348 gfx::Size bounds_; |
353 SkColor color_; | 349 SkColor color_; |
354 bool vertical_; | 350 bool vertical_; |
355 }; | 351 }; |
(...skipping 16 matching lines...) Expand all Loading... |
372 paint.setStyle(SkPaint::kFill_Style); | 368 paint.setStyle(SkPaint::kFill_Style); |
373 paint.setColor(SK_ColorWHITE); | 369 paint.setColor(SK_ColorWHITE); |
374 canvas->clear(SK_ColorTRANSPARENT); | 370 canvas->clear(SK_ColorTRANSPARENT); |
375 canvas->drawCircle(bounds_.width() / 2, | 371 canvas->drawCircle(bounds_.width() / 2, |
376 bounds_.height() / 2, | 372 bounds_.height() / 2, |
377 bounds_.width() / 4, | 373 bounds_.width() / 4, |
378 paint); | 374 paint); |
379 | 375 |
380 scoped_refptr<DisplayItemList> display_list = | 376 scoped_refptr<DisplayItemList> display_list = |
381 DisplayItemList::Create(PaintableRegion(), DisplayItemListSettings()); | 377 DisplayItemList::Create(PaintableRegion(), DisplayItemListSettings()); |
382 auto* item = display_list->CreateAndAppendItem<DrawingDisplayItem>( | |
383 PaintableRegion()); | |
384 skia::RefPtr<SkPicture> picture = | 378 skia::RefPtr<SkPicture> picture = |
385 skia::AdoptRef(recorder.endRecordingAsPicture()); | 379 skia::AdoptRef(recorder.endRecordingAsPicture()); |
386 item->SetNew(std::move(picture)); | 380 display_list->CreateAndAppendItem<DrawingDisplayItem>(PaintableRegion(), |
| 381 std::move(picture)); |
387 | 382 |
388 display_list->Finalize(); | 383 display_list->Finalize(); |
389 return display_list; | 384 return display_list; |
390 } | 385 } |
391 | 386 |
392 private: | 387 private: |
393 gfx::Size bounds_; | 388 gfx::Size bounds_; |
394 }; | 389 }; |
395 | 390 |
396 using LayerTreeHostMasksForBackgroundFiltersPixelTest = | 391 using LayerTreeHostMasksForBackgroundFiltersPixelTest = |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
504 | 499 |
505 RunPixelResourceTest(background, | 500 RunPixelResourceTest(background, |
506 base::FilePath( | 501 base::FilePath( |
507 FILE_PATH_LITERAL("mask_of_layer_with_blend.png"))); | 502 FILE_PATH_LITERAL("mask_of_layer_with_blend.png"))); |
508 } | 503 } |
509 | 504 |
510 } // namespace | 505 } // namespace |
511 } // namespace cc | 506 } // namespace cc |
512 | 507 |
513 #endif // !defined(OS_ANDROID) | 508 #endif // !defined(OS_ANDROID) |
OLD | NEW |