OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 #include "cc/input/scrollbar.h" | 9 #include "cc/input/scrollbar.h" |
10 #include "cc/layers/painted_scrollbar_layer.h" | 10 #include "cc/layers/painted_scrollbar_layer.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 | 60 |
61 gfx::Rect inset_rect = content_rect; | 61 gfx::Rect inset_rect = content_rect; |
62 while (!inset_rect.IsEmpty()) { | 62 while (!inset_rect.IsEmpty()) { |
63 int big = paint_scale_ + 2; | 63 int big = paint_scale_ + 2; |
64 int small = paint_scale_; | 64 int small = paint_scale_; |
65 inset_rect.Inset(big, big, small, small); | 65 inset_rect.Inset(big, big, small, small); |
66 canvas->drawRect(RectToSkRect(inset_rect), flags); | 66 canvas->drawRect(RectToSkRect(inset_rect), flags); |
67 inset_rect.Inset(big, big, small, small); | 67 inset_rect.Inset(big, big, small, small); |
68 } | 68 } |
69 } | 69 } |
| 70 bool UsesNinePatchThumbResource() const override { return false; } |
| 71 gfx::Size NinePatchThumbCanvasSize() const override { return gfx::Size(); } |
| 72 gfx::Rect NinePatchThumbAperture() const override { return gfx::Rect(); } |
70 | 73 |
71 void set_paint_scale(int scale) { paint_scale_ = scale; } | 74 void set_paint_scale(int scale) { paint_scale_ = scale; } |
72 | 75 |
73 private: | 76 private: |
74 int paint_scale_ = 4; | 77 int paint_scale_ = 4; |
75 bool thumb_ = false; | 78 bool thumb_ = false; |
76 SkColor color_ = SK_ColorGREEN; | 79 SkColor color_ = SK_ColorGREEN; |
77 gfx::Rect rect_; | 80 gfx::Rect rect_; |
78 }; | 81 }; |
79 | 82 |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 layer->SetTransform(scale_transform); | 168 layer->SetTransform(scale_transform); |
166 | 169 |
167 RunPixelTest(PIXEL_TEST_GL, background, | 170 RunPixelTest(PIXEL_TEST_GL, background, |
168 base::FilePath(FILE_PATH_LITERAL("spiral_64_scale.png"))); | 171 base::FilePath(FILE_PATH_LITERAL("spiral_64_scale.png"))); |
169 } | 172 } |
170 | 173 |
171 } // namespace | 174 } // namespace |
172 } // namespace cc | 175 } // namespace cc |
173 | 176 |
174 #endif // OS_ANDROID | 177 #endif // OS_ANDROID |
OLD | NEW |