| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 | 6 |
| 7 #include "cc/layers/content_layer_client.h" | 7 #include "cc/layers/content_layer_client.h" |
| 8 #include "cc/layers/picture_layer.h" | 8 #include "cc/layers/picture_layer.h" |
| 9 #include "cc/output/copy_output_request.h" | 9 #include "cc/output/copy_output_request.h" |
| 10 #include "cc/paint/paint_canvas.h" | 10 #include "cc/paint/paint_canvas.h" |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 | 115 |
| 116 PaintRecorder recorder; | 116 PaintRecorder recorder; |
| 117 PaintCanvas* canvas = | 117 PaintCanvas* canvas = |
| 118 recorder.beginRecording(gfx::RectToSkRect(gfx::Rect(size_))); | 118 recorder.beginRecording(gfx::RectToSkRect(gfx::Rect(size_))); |
| 119 gfx::Rect top(0, 0, size_.width(), size_.height() / 2); | 119 gfx::Rect top(0, 0, size_.width(), size_.height() / 2); |
| 120 gfx::Rect bottom(0, size_.height() / 2, size_.width(), size_.height() / 2); | 120 gfx::Rect bottom(0, size_.height() / 2, size_.width(), size_.height() / 2); |
| 121 | 121 |
| 122 gfx::Rect blue_rect = blue_top_ ? top : bottom; | 122 gfx::Rect blue_rect = blue_top_ ? top : bottom; |
| 123 gfx::Rect yellow_rect = blue_top_ ? bottom : top; | 123 gfx::Rect yellow_rect = blue_top_ ? bottom : top; |
| 124 | 124 |
| 125 PaintFlags paint; | 125 PaintFlags flags; |
| 126 paint.setStyle(PaintFlags::kFill_Style); | 126 flags.setStyle(PaintFlags::kFill_Style); |
| 127 | 127 |
| 128 paint.setColor(SK_ColorBLUE); | 128 flags.setColor(SK_ColorBLUE); |
| 129 canvas->drawRect(gfx::RectToSkRect(blue_rect), paint); | 129 canvas->drawRect(gfx::RectToSkRect(blue_rect), flags); |
| 130 paint.setColor(SK_ColorYELLOW); | 130 flags.setColor(SK_ColorYELLOW); |
| 131 canvas->drawRect(gfx::RectToSkRect(yellow_rect), paint); | 131 canvas->drawRect(gfx::RectToSkRect(yellow_rect), flags); |
| 132 | 132 |
| 133 display_list->CreateAndAppendDrawingItem<DrawingDisplayItem>( | 133 display_list->CreateAndAppendDrawingItem<DrawingDisplayItem>( |
| 134 PaintableRegion(), recorder.finishRecordingAsPicture()); | 134 PaintableRegion(), recorder.finishRecordingAsPicture()); |
| 135 display_list->Finalize(); | 135 display_list->Finalize(); |
| 136 return display_list; | 136 return display_list; |
| 137 } | 137 } |
| 138 | 138 |
| 139 bool FillsBoundsCompletely() const override { return true; } | 139 bool FillsBoundsCompletely() const override { return true; } |
| 140 size_t GetApproximateUnsharedMemoryUsage() const override { return 0; } | 140 size_t GetApproximateUnsharedMemoryUsage() const override { return 0; } |
| 141 | 141 |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 FullRaster_SingleThread_GpuRaster) { | 244 FullRaster_SingleThread_GpuRaster) { |
| 245 RunRasterPixelTest( | 245 RunRasterPixelTest( |
| 246 false, FULL_GPU, picture_layer_, | 246 false, FULL_GPU, picture_layer_, |
| 247 base::FilePath(FILE_PATH_LITERAL("blue_yellow_flipped.png"))); | 247 base::FilePath(FILE_PATH_LITERAL("blue_yellow_flipped.png"))); |
| 248 } | 248 } |
| 249 | 249 |
| 250 } // namespace | 250 } // namespace |
| 251 } // namespace cc | 251 } // namespace cc |
| 252 | 252 |
| 253 #endif // !defined(OS_ANDROID) | 253 #endif // !defined(OS_ANDROID) |
| OLD | NEW |