OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 // TODO(awalker): clean up the const/non-const reference handling in this test | 5 // TODO(awalker): clean up the const/non-const reference handling in this test |
6 | 6 |
7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
8 | 8 |
9 #if defined(OS_MACOSX) | 9 #if defined(OS_MACOSX) |
10 #import <ApplicationServices/ApplicationServices.h> | 10 #import <ApplicationServices/ApplicationServices.h> |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 LayerSaver(PlatformCanvas& canvas, int x, int y, int w, int h) | 145 LayerSaver(PlatformCanvas& canvas, int x, int y, int w, int h) |
146 : canvas_(canvas), | 146 : canvas_(canvas), |
147 x_(x), | 147 x_(x), |
148 y_(y), | 148 y_(y), |
149 w_(w), | 149 w_(w), |
150 h_(h) { | 150 h_(h) { |
151 SkRect bounds; | 151 SkRect bounds; |
152 bounds.set(SkIntToScalar(x_), SkIntToScalar(y_), | 152 bounds.set(SkIntToScalar(x_), SkIntToScalar(y_), |
153 SkIntToScalar(right()), SkIntToScalar(bottom())); | 153 SkIntToScalar(right()), SkIntToScalar(bottom())); |
154 canvas_.saveLayer(&bounds, NULL); | 154 canvas_.saveLayer(&bounds, NULL); |
| 155 canvas.clear(SkColorSetARGB(0, 0, 0, 0)); |
155 } | 156 } |
156 | 157 |
157 ~LayerSaver() { | 158 ~LayerSaver() { |
158 canvas_.restore(); | 159 canvas_.restore(); |
159 } | 160 } |
160 | 161 |
161 int x() const { return x_; } | 162 int x() const { return x_; } |
162 int y() const { return y_; } | 163 int y() const { return y_; } |
163 int w() const { return w_; } | 164 int w() const { return w_; } |
164 int h() const { return h_; } | 165 int h() const { return h_; } |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 MakeOpaque(&canvas, kLayerX, kLayerY, kLayerW, kLayerH); | 381 MakeOpaque(&canvas, kLayerX, kLayerY, kLayerW, kLayerH); |
381 #endif | 382 #endif |
382 } | 383 } |
383 canvas.restore(); | 384 canvas.restore(); |
384 EXPECT_TRUE(VerifyRoundedRect(canvas, SK_ColorWHITE, SK_ColorBLACK, | 385 EXPECT_TRUE(VerifyRoundedRect(canvas, SK_ColorWHITE, SK_ColorBLACK, |
385 kInnerX + 1, kInnerY + 1, kInnerW, kInnerH)); | 386 kInnerX + 1, kInnerY + 1, kInnerW, kInnerH)); |
386 #endif | 387 #endif |
387 } | 388 } |
388 | 389 |
389 } // namespace skia | 390 } // namespace skia |
OLD | NEW |