| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 while (!inset_rect.IsEmpty()) { | 50 while (!inset_rect.IsEmpty()) { |
| 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(DisplayItemListSettings()); |
| 61 auto* item = display_list->CreateAndAppendItem<DrawingDisplayItem>( | 61 auto* item = display_list->CreateAndAppendItem<DrawingDisplayItem>(Paintable
Region()); |
| 62 PaintableRegion()); | |
| 63 | 62 |
| 64 skia::RefPtr<SkPicture> picture = | 63 skia::RefPtr<SkPicture> picture = |
| 65 skia::AdoptRef(recorder.endRecordingAsPicture()); | 64 skia::AdoptRef(recorder.endRecordingAsPicture()); |
| 66 item->SetNew(std::move(picture)); | 65 item->SetNew(std::move(picture)); |
| 67 | 66 |
| 68 display_list->Finalize(); | 67 display_list->Finalize(); |
| 69 return display_list; | 68 return display_list; |
| 70 } | 69 } |
| 71 | 70 |
| 72 private: | 71 private: |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 for (int i = 4; i < bounds_.width(); i += 16) { | 328 for (int i = 4; i < bounds_.width(); i += 16) { |
| 330 canvas->drawLine(i, 0, i, bounds_.height(), paint); | 329 canvas->drawLine(i, 0, i, bounds_.height(), paint); |
| 331 } | 330 } |
| 332 } else { | 331 } else { |
| 333 for (int i = 4; i < bounds_.height(); i += 16) { | 332 for (int i = 4; i < bounds_.height(); i += 16) { |
| 334 canvas->drawLine(0, i, bounds_.width(), i, paint); | 333 canvas->drawLine(0, i, bounds_.width(), i, paint); |
| 335 } | 334 } |
| 336 } | 335 } |
| 337 | 336 |
| 338 scoped_refptr<DisplayItemList> display_list = | 337 scoped_refptr<DisplayItemList> display_list = |
| 339 DisplayItemList::Create(PaintableRegion(), DisplayItemListSettings()); | 338 DisplayItemList::Create(DisplayItemListSettings()); |
| 340 auto* item = display_list->CreateAndAppendItem<DrawingDisplayItem>( | 339 auto* item = display_list->CreateAndAppendItem<DrawingDisplayItem>( |
| 341 PaintableRegion()); | 340 PaintableRegion()); |
| 342 | 341 |
| 343 skia::RefPtr<SkPicture> picture = | 342 skia::RefPtr<SkPicture> picture = |
| 344 skia::AdoptRef(recorder.endRecordingAsPicture()); | 343 skia::AdoptRef(recorder.endRecordingAsPicture()); |
| 345 item->SetNew(std::move(picture)); | 344 item->SetNew(std::move(picture)); |
| 346 | 345 |
| 347 display_list->Finalize(); | 346 display_list->Finalize(); |
| 348 return display_list; | 347 return display_list; |
| 349 } | 348 } |
| (...skipping 21 matching lines...) Expand all Loading... |
| 371 SkPaint paint; | 370 SkPaint paint; |
| 372 paint.setStyle(SkPaint::kFill_Style); | 371 paint.setStyle(SkPaint::kFill_Style); |
| 373 paint.setColor(SK_ColorWHITE); | 372 paint.setColor(SK_ColorWHITE); |
| 374 canvas->clear(SK_ColorTRANSPARENT); | 373 canvas->clear(SK_ColorTRANSPARENT); |
| 375 canvas->drawCircle(bounds_.width() / 2, | 374 canvas->drawCircle(bounds_.width() / 2, |
| 376 bounds_.height() / 2, | 375 bounds_.height() / 2, |
| 377 bounds_.width() / 4, | 376 bounds_.width() / 4, |
| 378 paint); | 377 paint); |
| 379 | 378 |
| 380 scoped_refptr<DisplayItemList> display_list = | 379 scoped_refptr<DisplayItemList> display_list = |
| 381 DisplayItemList::Create(PaintableRegion(), DisplayItemListSettings()); | 380 DisplayItemList::Create(DisplayItemListSettings()); |
| 382 auto* item = display_list->CreateAndAppendItem<DrawingDisplayItem>( | 381 auto* item = display_list->CreateAndAppendItem<DrawingDisplayItem>( |
| 383 PaintableRegion()); | 382 PaintableRegion()); |
| 384 skia::RefPtr<SkPicture> picture = | 383 skia::RefPtr<SkPicture> picture = |
| 385 skia::AdoptRef(recorder.endRecordingAsPicture()); | 384 skia::AdoptRef(recorder.endRecordingAsPicture()); |
| 386 item->SetNew(std::move(picture)); | 385 item->SetNew(std::move(picture)); |
| 387 | 386 |
| 388 display_list->Finalize(); | 387 display_list->Finalize(); |
| 389 return display_list; | 388 return display_list; |
| 390 } | 389 } |
| 391 | 390 |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 504 | 503 |
| 505 RunPixelResourceTest(background, | 504 RunPixelResourceTest(background, |
| 506 base::FilePath( | 505 base::FilePath( |
| 507 FILE_PATH_LITERAL("mask_of_layer_with_blend.png"))); | 506 FILE_PATH_LITERAL("mask_of_layer_with_blend.png"))); |
| 508 } | 507 } |
| 509 | 508 |
| 510 } // namespace | 509 } // namespace |
| 511 } // namespace cc | 510 } // namespace cc |
| 512 | 511 |
| 513 #endif // !defined(OS_ANDROID) | 512 #endif // !defined(OS_ANDROID) |
| OLD | NEW |