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 "third_party/skia/include/core/SkCanvas.h" | 7 #include "third_party/skia/include/core/SkCanvas.h" |
8 #include "third_party/skia/include/core/SkPaint.h" | 8 #include "third_party/skia/include/core/SkPaint.h" |
9 #include "ui/gfx/rect.h" | 9 #include "ui/gfx/geometry/rect.h" |
10 #include "ui/gfx/rect_f.h" | 10 #include "ui/gfx/geometry/rect_f.h" |
11 | 11 |
12 namespace cc { | 12 namespace cc { |
13 | 13 |
14 void SolidColorContentLayerClient::PaintContents( | 14 void SolidColorContentLayerClient::PaintContents( |
15 SkCanvas* canvas, | 15 SkCanvas* canvas, |
16 const gfx::Rect& rect, | 16 const gfx::Rect& rect, |
17 ContentLayerClient::GraphicsContextStatus gc_status) { | 17 ContentLayerClient::GraphicsContextStatus gc_status) { |
18 SkPaint paint; | 18 SkPaint paint; |
19 paint.setStyle(SkPaint::kFill_Style); | 19 paint.setStyle(SkPaint::kFill_Style); |
20 paint.setColor(color_); | 20 paint.setColor(color_); |
21 | 21 |
22 canvas->clear(SK_ColorTRANSPARENT); | 22 canvas->clear(SK_ColorTRANSPARENT); |
23 canvas->drawRect( | 23 canvas->drawRect( |
24 SkRect::MakeXYWH(rect.x(), rect.y(), rect.width(), rect.height()), | 24 SkRect::MakeXYWH(rect.x(), rect.y(), rect.width(), rect.height()), |
25 paint); | 25 paint); |
26 } | 26 } |
27 | 27 |
28 bool SolidColorContentLayerClient::FillsBoundsCompletely() const { | 28 bool SolidColorContentLayerClient::FillsBoundsCompletely() const { |
29 return false; | 29 return false; |
30 } | 30 } |
31 | 31 |
32 } // namespace cc | 32 } // namespace cc |
OLD | NEW |