| 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 while (!inset_rect.IsEmpty()) { | 52 while (!inset_rect.IsEmpty()) { |
| 53 inset_rect.Inset(3, 3, 2, 2); | 53 inset_rect.Inset(3, 3, 2, 2); |
| 54 canvas->drawRect( | 54 canvas->drawRect( |
| 55 SkRect::MakeXYWH(inset_rect.x(), inset_rect.y(), | 55 SkRect::MakeXYWH(inset_rect.x(), inset_rect.y(), |
| 56 inset_rect.width(), inset_rect.height()), | 56 inset_rect.width(), inset_rect.height()), |
| 57 paint); | 57 paint); |
| 58 inset_rect.Inset(3, 3, 2, 2); | 58 inset_rect.Inset(3, 3, 2, 2); |
| 59 } | 59 } |
| 60 | 60 |
| 61 scoped_refptr<DisplayItemList> display_list = | 61 scoped_refptr<DisplayItemList> display_list = |
| 62 DisplayItemList::Create(PaintableRegion(), DisplayItemListSettings()); | 62 DisplayItemList::Create(DisplayItemListSettings()); |
| 63 display_list->CreateAndAppendItem<DrawingDisplayItem>( | 63 display_list->CreateAndAppendItem<DrawingDisplayItem>( |
| 64 PaintableRegion(), recorder.finishRecordingAsPicture()); | 64 PaintableRegion(), recorder.finishRecordingAsPicture()); |
| 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: |
| 71 gfx::Size bounds_; | 71 gfx::Size bounds_; |
| 72 }; | 72 }; |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 for (int i = 4; i < bounds_.width(); i += 16) { | 320 for (int i = 4; i < bounds_.width(); i += 16) { |
| 321 canvas->drawLine(i, 0, i, bounds_.height(), paint); | 321 canvas->drawLine(i, 0, i, bounds_.height(), paint); |
| 322 } | 322 } |
| 323 } else { | 323 } else { |
| 324 for (int i = 4; i < bounds_.height(); i += 16) { | 324 for (int i = 4; i < bounds_.height(); i += 16) { |
| 325 canvas->drawLine(0, i, bounds_.width(), i, paint); | 325 canvas->drawLine(0, i, bounds_.width(), i, paint); |
| 326 } | 326 } |
| 327 } | 327 } |
| 328 | 328 |
| 329 scoped_refptr<DisplayItemList> display_list = | 329 scoped_refptr<DisplayItemList> display_list = |
| 330 DisplayItemList::Create(PaintableRegion(), DisplayItemListSettings()); | 330 DisplayItemList::Create(DisplayItemListSettings()); |
| 331 display_list->CreateAndAppendItem<DrawingDisplayItem>( | 331 display_list->CreateAndAppendItem<DrawingDisplayItem>( |
| 332 PaintableRegion(), recorder.finishRecordingAsPicture()); | 332 PaintableRegion(), recorder.finishRecordingAsPicture()); |
| 333 | 333 |
| 334 display_list->Finalize(); | 334 display_list->Finalize(); |
| 335 return display_list; | 335 return display_list; |
| 336 } | 336 } |
| 337 | 337 |
| 338 private: | 338 private: |
| 339 gfx::Size bounds_; | 339 gfx::Size bounds_; |
| 340 SkColor color_; | 340 SkColor color_; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 358 SkPaint paint; | 358 SkPaint paint; |
| 359 paint.setStyle(SkPaint::kFill_Style); | 359 paint.setStyle(SkPaint::kFill_Style); |
| 360 paint.setColor(SK_ColorWHITE); | 360 paint.setColor(SK_ColorWHITE); |
| 361 canvas->clear(SK_ColorTRANSPARENT); | 361 canvas->clear(SK_ColorTRANSPARENT); |
| 362 canvas->drawCircle(bounds_.width() / 2, | 362 canvas->drawCircle(bounds_.width() / 2, |
| 363 bounds_.height() / 2, | 363 bounds_.height() / 2, |
| 364 bounds_.width() / 4, | 364 bounds_.width() / 4, |
| 365 paint); | 365 paint); |
| 366 | 366 |
| 367 scoped_refptr<DisplayItemList> display_list = | 367 scoped_refptr<DisplayItemList> display_list = |
| 368 DisplayItemList::Create(PaintableRegion(), DisplayItemListSettings()); | 368 DisplayItemList::Create(DisplayItemListSettings()); |
| 369 display_list->CreateAndAppendItem<DrawingDisplayItem>( | 369 display_list->CreateAndAppendItem<DrawingDisplayItem>( |
| 370 PaintableRegion(), recorder.finishRecordingAsPicture()); | 370 PaintableRegion(), recorder.finishRecordingAsPicture()); |
| 371 | 371 |
| 372 display_list->Finalize(); | 372 display_list->Finalize(); |
| 373 return display_list; | 373 return display_list; |
| 374 } | 374 } |
| 375 | 375 |
| 376 private: | 376 private: |
| 377 gfx::Size bounds_; | 377 gfx::Size bounds_; |
| 378 }; | 378 }; |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 485 | 485 |
| 486 RunPixelResourceTest(background, | 486 RunPixelResourceTest(background, |
| 487 base::FilePath( | 487 base::FilePath( |
| 488 FILE_PATH_LITERAL("mask_of_layer_with_blend.png"))); | 488 FILE_PATH_LITERAL("mask_of_layer_with_blend.png"))); |
| 489 } | 489 } |
| 490 | 490 |
| 491 } // namespace | 491 } // namespace |
| 492 } // namespace cc | 492 } // namespace cc |
| 493 | 493 |
| 494 #endif // !defined(OS_ANDROID) | 494 #endif // !defined(OS_ANDROID) |
| OLD | NEW |