OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef UI_GFX_CANVAS_H_ | 5 #ifndef UI_GFX_CANVAS_H_ |
6 #define UI_GFX_CANVAS_H_ | 6 #define UI_GFX_CANVAS_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 // Adds |path| to the current clip. Returns true if the resulting clip is | 189 // Adds |path| to the current clip. Returns true if the resulting clip is |
190 // non-empty. | 190 // non-empty. |
191 bool ClipPath(const SkPath& path); | 191 bool ClipPath(const SkPath& path); |
192 | 192 |
193 // Returns the bounds of the current clip (in local coordinates) in the | 193 // Returns the bounds of the current clip (in local coordinates) in the |
194 // |bounds| parameter, and returns true if it is non empty. | 194 // |bounds| parameter, and returns true if it is non empty. |
195 bool GetClipBounds(gfx::Rect* bounds); | 195 bool GetClipBounds(gfx::Rect* bounds); |
196 | 196 |
197 void Translate(const gfx::Vector2d& offset); | 197 void Translate(const gfx::Vector2d& offset); |
198 | 198 |
| 199 #if defined(ENABLE_HIDPI) |
| 200 void Scale(double x_scale, double y_scale); |
| 201 #else |
199 void Scale(int x_scale, int y_scale); | 202 void Scale(int x_scale, int y_scale); |
| 203 #endif |
200 | 204 |
201 // Fills the entire canvas' bitmap (restricted to current clip) with | 205 // Fills the entire canvas' bitmap (restricted to current clip) with |
202 // specified |color| using a transfer mode of SkXfermode::kSrcOver_Mode. | 206 // specified |color| using a transfer mode of SkXfermode::kSrcOver_Mode. |
203 void DrawColor(SkColor color); | 207 void DrawColor(SkColor color); |
204 | 208 |
205 // Fills the entire canvas' bitmap (restricted to current clip) with | 209 // Fills the entire canvas' bitmap (restricted to current clip) with |
206 // specified |color| and |mode|. | 210 // specified |color| and |mode|. |
207 void DrawColor(SkColor color, SkXfermode::Mode mode); | 211 void DrawColor(SkColor color, SkXfermode::Mode mode); |
208 | 212 |
209 // Fills |rect| with |color| using a transfer mode of | 213 // Fills |rect| with |color| using a transfer mode of |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 | 405 |
402 skia::RefPtr<skia::PlatformCanvas> owned_canvas_; | 406 skia::RefPtr<skia::PlatformCanvas> owned_canvas_; |
403 SkCanvas* canvas_; | 407 SkCanvas* canvas_; |
404 | 408 |
405 DISALLOW_COPY_AND_ASSIGN(Canvas); | 409 DISALLOW_COPY_AND_ASSIGN(Canvas); |
406 }; | 410 }; |
407 | 411 |
408 } // namespace gfx | 412 } // namespace gfx |
409 | 413 |
410 #endif // UI_GFX_CANVAS_H_ | 414 #endif // UI_GFX_CANVAS_H_ |
OLD | NEW |