| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 | 6 |
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 #include "cc/layers/content_layer_client.h" | 8 #include "cc/layers/content_layer_client.h" |
| 9 #include "cc/layers/picture_image_layer.h" | 9 #include "cc/layers/picture_image_layer.h" |
| 10 #include "cc/layers/picture_layer.h" | 10 #include "cc/layers/picture_layer.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 while (!inset_rect.IsEmpty()) { | 53 while (!inset_rect.IsEmpty()) { |
| 54 inset_rect.Inset(3, 3, 2, 2); | 54 inset_rect.Inset(3, 3, 2, 2); |
| 55 canvas->drawRect( | 55 canvas->drawRect( |
| 56 SkRect::MakeXYWH(inset_rect.x(), inset_rect.y(), | 56 SkRect::MakeXYWH(inset_rect.x(), inset_rect.y(), |
| 57 inset_rect.width(), inset_rect.height()), | 57 inset_rect.width(), inset_rect.height()), |
| 58 paint); | 58 paint); |
| 59 inset_rect.Inset(3, 3, 2, 2); | 59 inset_rect.Inset(3, 3, 2, 2); |
| 60 } | 60 } |
| 61 | 61 |
| 62 scoped_refptr<DisplayItemList> display_list = | 62 scoped_refptr<DisplayItemList> display_list = |
| 63 DisplayItemList::Create(PaintableRegion(), DisplayItemListSettings()); | 63 DisplayItemList::Create(DisplayItemListSettings()); |
| 64 display_list->CreateAndAppendDrawingItem<DrawingDisplayItem>( | 64 display_list->CreateAndAppendDrawingItem<DrawingDisplayItem>( |
| 65 PaintableRegion(), recorder.finishRecordingAsPicture()); | 65 PaintableRegion(), recorder.finishRecordingAsPicture()); |
| 66 | 66 |
| 67 display_list->Finalize(); | 67 display_list->Finalize(); |
| 68 return display_list; | 68 return display_list; |
| 69 } | 69 } |
| 70 | 70 |
| 71 private: | 71 private: |
| 72 gfx::Size bounds_; | 72 gfx::Size bounds_; |
| 73 }; | 73 }; |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 353 for (int i = 4; i < bounds_.width(); i += 16) { | 353 for (int i = 4; i < bounds_.width(); i += 16) { |
| 354 canvas->drawLine(i, 0, i, bounds_.height(), paint); | 354 canvas->drawLine(i, 0, i, bounds_.height(), paint); |
| 355 } | 355 } |
| 356 } else { | 356 } else { |
| 357 for (int i = 4; i < bounds_.height(); i += 16) { | 357 for (int i = 4; i < bounds_.height(); i += 16) { |
| 358 canvas->drawLine(0, i, bounds_.width(), i, paint); | 358 canvas->drawLine(0, i, bounds_.width(), i, paint); |
| 359 } | 359 } |
| 360 } | 360 } |
| 361 | 361 |
| 362 scoped_refptr<DisplayItemList> display_list = | 362 scoped_refptr<DisplayItemList> display_list = |
| 363 DisplayItemList::Create(PaintableRegion(), DisplayItemListSettings()); | 363 DisplayItemList::Create(DisplayItemListSettings()); |
| 364 display_list->CreateAndAppendDrawingItem<DrawingDisplayItem>( | 364 display_list->CreateAndAppendDrawingItem<DrawingDisplayItem>( |
| 365 PaintableRegion(), recorder.finishRecordingAsPicture()); | 365 PaintableRegion(), recorder.finishRecordingAsPicture()); |
| 366 | 366 |
| 367 display_list->Finalize(); | 367 display_list->Finalize(); |
| 368 return display_list; | 368 return display_list; |
| 369 } | 369 } |
| 370 | 370 |
| 371 private: | 371 private: |
| 372 gfx::Size bounds_; | 372 gfx::Size bounds_; |
| 373 SkColor color_; | 373 SkColor color_; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 391 SkPaint paint; | 391 SkPaint paint; |
| 392 paint.setStyle(SkPaint::kFill_Style); | 392 paint.setStyle(SkPaint::kFill_Style); |
| 393 paint.setColor(SK_ColorWHITE); | 393 paint.setColor(SK_ColorWHITE); |
| 394 canvas->clear(SK_ColorTRANSPARENT); | 394 canvas->clear(SK_ColorTRANSPARENT); |
| 395 canvas->drawCircle(bounds_.width() / 2, | 395 canvas->drawCircle(bounds_.width() / 2, |
| 396 bounds_.height() / 2, | 396 bounds_.height() / 2, |
| 397 bounds_.width() / 4, | 397 bounds_.width() / 4, |
| 398 paint); | 398 paint); |
| 399 | 399 |
| 400 scoped_refptr<DisplayItemList> display_list = | 400 scoped_refptr<DisplayItemList> display_list = |
| 401 DisplayItemList::Create(PaintableRegion(), DisplayItemListSettings()); | 401 DisplayItemList::Create(DisplayItemListSettings()); |
| 402 display_list->CreateAndAppendDrawingItem<DrawingDisplayItem>( | 402 display_list->CreateAndAppendDrawingItem<DrawingDisplayItem>( |
| 403 PaintableRegion(), recorder.finishRecordingAsPicture()); | 403 PaintableRegion(), recorder.finishRecordingAsPicture()); |
| 404 | 404 |
| 405 display_list->Finalize(); | 405 display_list->Finalize(); |
| 406 return display_list; | 406 return display_list; |
| 407 } | 407 } |
| 408 | 408 |
| 409 private: | 409 private: |
| 410 gfx::Size bounds_; | 410 gfx::Size bounds_; |
| 411 }; | 411 }; |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 518 | 518 |
| 519 RunPixelResourceTest(background, | 519 RunPixelResourceTest(background, |
| 520 base::FilePath( | 520 base::FilePath( |
| 521 FILE_PATH_LITERAL("mask_of_layer_with_blend.png"))); | 521 FILE_PATH_LITERAL("mask_of_layer_with_blend.png"))); |
| 522 } | 522 } |
| 523 | 523 |
| 524 } // namespace | 524 } // namespace |
| 525 } // namespace cc | 525 } // namespace cc |
| 526 | 526 |
| 527 #endif // !defined(OS_ANDROID) | 527 #endif // !defined(OS_ANDROID) |
| OLD | NEW |