OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/layers/content_layer_client.h" | 5 #include "cc/layers/content_layer_client.h" |
6 #include "cc/layers/picture_layer.h" | 6 #include "cc/layers/picture_layer.h" |
7 #include "cc/output/copy_output_request.h" | 7 #include "cc/output/copy_output_request.h" |
8 #include "cc/playback/display_item_list.h" | 8 #include "cc/playback/display_item_list.h" |
9 #include "cc/playback/display_item_list_settings.h" | 9 #include "cc/playback/display_item_list_settings.h" |
10 #include "cc/playback/drawing_display_item.h" | 10 #include "cc/playback/drawing_display_item.h" |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 gfx::Rect yellow_rect = blue_top_ ? bottom : top; | 123 gfx::Rect yellow_rect = blue_top_ ? bottom : top; |
124 | 124 |
125 SkPaint paint; | 125 SkPaint paint; |
126 paint.setStyle(SkPaint::kFill_Style); | 126 paint.setStyle(SkPaint::kFill_Style); |
127 | 127 |
128 paint.setColor(SK_ColorBLUE); | 128 paint.setColor(SK_ColorBLUE); |
129 canvas->drawRect(gfx::RectToSkRect(blue_rect), paint); | 129 canvas->drawRect(gfx::RectToSkRect(blue_rect), paint); |
130 paint.setColor(SK_ColorYELLOW); | 130 paint.setColor(SK_ColorYELLOW); |
131 canvas->drawRect(gfx::RectToSkRect(yellow_rect), paint); | 131 canvas->drawRect(gfx::RectToSkRect(yellow_rect), paint); |
132 | 132 |
133 skia::RefPtr<SkPicture> picture = | 133 display_list->CreateAndAppendItem<DrawingDisplayItem>( |
134 skia::AdoptRef(recorder.endRecordingAsPicture()); | 134 PaintableRegion(), skia::AdoptRef(recorder.endRecordingAsPicture())); |
135 | |
136 auto* item = display_list->CreateAndAppendItem<DrawingDisplayItem>( | |
137 PaintableRegion()); | |
138 item->SetNew(std::move(picture)); | |
139 | |
140 display_list->Finalize(); | 135 display_list->Finalize(); |
141 return display_list; | 136 return display_list; |
142 } | 137 } |
143 | 138 |
144 bool FillsBoundsCompletely() const override { return true; } | 139 bool FillsBoundsCompletely() const override { return true; } |
145 size_t GetApproximateUnsharedMemoryUsage() const override { return 0; } | 140 size_t GetApproximateUnsharedMemoryUsage() const override { return 0; } |
146 | 141 |
147 void set_blue_top(bool b) { blue_top_ = b; } | 142 void set_blue_top(bool b) { blue_top_ = b; } |
148 | 143 |
149 private: | 144 private: |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 FullRaster_SingleThread_GpuRaster) { | 232 FullRaster_SingleThread_GpuRaster) { |
238 RunRasterPixelTest( | 233 RunRasterPixelTest( |
239 false, FULL_GPU, picture_layer_, | 234 false, FULL_GPU, picture_layer_, |
240 base::FilePath(FILE_PATH_LITERAL("blue_yellow_flipped.png"))); | 235 base::FilePath(FILE_PATH_LITERAL("blue_yellow_flipped.png"))); |
241 } | 236 } |
242 | 237 |
243 } // namespace | 238 } // namespace |
244 } // namespace cc | 239 } // namespace cc |
245 | 240 |
246 #endif // !defined(OS_ANDROID) | 241 #endif // !defined(OS_ANDROID) |
OLD | NEW |