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 "cc/test/solid_color_content_layer_client.h" | 5 #include "cc/test/solid_color_content_layer_client.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "cc/paint/drawing_display_item.h" | 9 #include "cc/paint/drawing_display_item.h" |
10 #include "cc/paint/paint_canvas.h" | 10 #include "cc/paint/paint_canvas.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 flags.setStyle(PaintFlags::kFill_Style); | 42 flags.setStyle(PaintFlags::kFill_Style); |
43 flags.setColor(color_); | 43 flags.setColor(color_); |
44 canvas->drawRect( | 44 canvas->drawRect( |
45 SkRect::MakeXYWH(clip.x() + border_size_, clip.y() + border_size_, | 45 SkRect::MakeXYWH(clip.x() + border_size_, clip.y() + border_size_, |
46 clip.width() - 2 * border_size_, | 46 clip.width() - 2 * border_size_, |
47 clip.height() - 2 * border_size_), | 47 clip.height() - 2 * border_size_), |
48 flags); | 48 flags); |
49 | 49 |
50 auto display_list = make_scoped_refptr(new DisplayItemList); | 50 auto display_list = make_scoped_refptr(new DisplayItemList); |
51 display_list->CreateAndAppendDrawingItem<DrawingDisplayItem>( | 51 display_list->CreateAndAppendDrawingItem<DrawingDisplayItem>( |
52 clip, recorder.finishRecordingAsPicture()); | 52 clip, recorder.finishRecordingAsPicture(), gfx::RectToSkRect(clip)); |
53 | 53 |
54 display_list->Finalize(); | 54 display_list->Finalize(); |
55 return display_list; | 55 return display_list; |
56 } | 56 } |
57 | 57 |
58 bool SolidColorContentLayerClient::FillsBoundsCompletely() const { | 58 bool SolidColorContentLayerClient::FillsBoundsCompletely() const { |
59 return false; | 59 return false; |
60 } | 60 } |
61 | 61 |
62 size_t SolidColorContentLayerClient::GetApproximateUnsharedMemoryUsage() const { | 62 size_t SolidColorContentLayerClient::GetApproximateUnsharedMemoryUsage() const { |
63 return 0; | 63 return 0; |
64 } | 64 } |
65 | 65 |
66 } // namespace cc | 66 } // namespace cc |
OLD | NEW |