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