| 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 inset_rect.Inset(3, 3, 2, 2); | 50 inset_rect.Inset(3, 3, 2, 2); |
| 51 canvas->drawRect( | 51 canvas->drawRect( |
| 52 SkRect::MakeXYWH(inset_rect.x(), inset_rect.y(), | 52 SkRect::MakeXYWH(inset_rect.x(), inset_rect.y(), |
| 53 inset_rect.width(), inset_rect.height()), | 53 inset_rect.width(), inset_rect.height()), |
| 54 paint); | 54 paint); |
| 55 inset_rect.Inset(3, 3, 2, 2); | 55 inset_rect.Inset(3, 3, 2, 2); |
| 56 } | 56 } |
| 57 | 57 |
| 58 scoped_refptr<DisplayItemList> display_list = | 58 scoped_refptr<DisplayItemList> display_list = |
| 59 DisplayItemList::Create(clip, DisplayItemListSettings()); | 59 DisplayItemList::Create(clip, DisplayItemListSettings()); |
| 60 auto* item = display_list->CreateAndAppendItem<DrawingDisplayItem>(); | 60 auto* item = display_list->CreateAndAppendItem<DrawingDisplayItem>(clip); |
| 61 | 61 |
| 62 skia::RefPtr<SkPicture> picture = | 62 skia::RefPtr<SkPicture> picture = |
| 63 skia::AdoptRef(recorder.endRecordingAsPicture()); | 63 skia::AdoptRef(recorder.endRecordingAsPicture()); |
| 64 item->SetNew(picture.Pass()); | 64 item->SetNew(picture.Pass()); |
| 65 | 65 |
| 66 display_list->Finalize(); | 66 display_list->Finalize(); |
| 67 return display_list; | 67 return display_list; |
| 68 } | 68 } |
| 69 | 69 |
| 70 private: | 70 private: |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 canvas->drawLine(i, 0, i, bounds_.height(), paint); | 328 canvas->drawLine(i, 0, i, bounds_.height(), paint); |
| 329 } | 329 } |
| 330 } else { | 330 } else { |
| 331 for (int i = 4; i < bounds_.height(); i += 16) { | 331 for (int i = 4; i < bounds_.height(); i += 16) { |
| 332 canvas->drawLine(0, i, bounds_.width(), i, paint); | 332 canvas->drawLine(0, i, bounds_.width(), i, paint); |
| 333 } | 333 } |
| 334 } | 334 } |
| 335 | 335 |
| 336 scoped_refptr<DisplayItemList> display_list = | 336 scoped_refptr<DisplayItemList> display_list = |
| 337 DisplayItemList::Create(clip, DisplayItemListSettings()); | 337 DisplayItemList::Create(clip, DisplayItemListSettings()); |
| 338 auto* item = display_list->CreateAndAppendItem<DrawingDisplayItem>(); | 338 auto* item = display_list->CreateAndAppendItem<DrawingDisplayItem>(clip); |
| 339 | 339 |
| 340 skia::RefPtr<SkPicture> picture = | 340 skia::RefPtr<SkPicture> picture = |
| 341 skia::AdoptRef(recorder.endRecordingAsPicture()); | 341 skia::AdoptRef(recorder.endRecordingAsPicture()); |
| 342 item->SetNew(picture.Pass()); | 342 item->SetNew(picture.Pass()); |
| 343 | 343 |
| 344 display_list->Finalize(); | 344 display_list->Finalize(); |
| 345 return display_list; | 345 return display_list; |
| 346 } | 346 } |
| 347 | 347 |
| 348 private: | 348 private: |
| (...skipping 20 matching lines...) Expand all Loading... |
| 369 paint.setStyle(SkPaint::kFill_Style); | 369 paint.setStyle(SkPaint::kFill_Style); |
| 370 paint.setColor(SK_ColorWHITE); | 370 paint.setColor(SK_ColorWHITE); |
| 371 canvas->clear(SK_ColorTRANSPARENT); | 371 canvas->clear(SK_ColorTRANSPARENT); |
| 372 canvas->drawCircle(bounds_.width() / 2, | 372 canvas->drawCircle(bounds_.width() / 2, |
| 373 bounds_.height() / 2, | 373 bounds_.height() / 2, |
| 374 bounds_.width() / 4, | 374 bounds_.width() / 4, |
| 375 paint); | 375 paint); |
| 376 | 376 |
| 377 scoped_refptr<DisplayItemList> display_list = | 377 scoped_refptr<DisplayItemList> display_list = |
| 378 DisplayItemList::Create(clip, DisplayItemListSettings()); | 378 DisplayItemList::Create(clip, DisplayItemListSettings()); |
| 379 auto* item = display_list->CreateAndAppendItem<DrawingDisplayItem>(); | 379 auto* item = display_list->CreateAndAppendItem<DrawingDisplayItem>(clip); |
| 380 skia::RefPtr<SkPicture> picture = | 380 skia::RefPtr<SkPicture> picture = |
| 381 skia::AdoptRef(recorder.endRecordingAsPicture()); | 381 skia::AdoptRef(recorder.endRecordingAsPicture()); |
| 382 item->SetNew(picture.Pass()); | 382 item->SetNew(picture.Pass()); |
| 383 | 383 |
| 384 display_list->Finalize(); | 384 display_list->Finalize(); |
| 385 return display_list; | 385 return display_list; |
| 386 } | 386 } |
| 387 | 387 |
| 388 private: | 388 private: |
| 389 gfx::Size bounds_; | 389 gfx::Size bounds_; |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 500 | 500 |
| 501 RunPixelResourceTest(background, | 501 RunPixelResourceTest(background, |
| 502 base::FilePath( | 502 base::FilePath( |
| 503 FILE_PATH_LITERAL("mask_of_layer_with_blend.png"))); | 503 FILE_PATH_LITERAL("mask_of_layer_with_blend.png"))); |
| 504 } | 504 } |
| 505 | 505 |
| 506 } // namespace | 506 } // namespace |
| 507 } // namespace cc | 507 } // namespace cc |
| 508 | 508 |
| 509 #endif // !defined(OS_ANDROID) | 509 #endif // !defined(OS_ANDROID) |
| OLD | NEW |