OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 | 96 |
97 // Restores the drawing state after a call to Save*(). It is an error to | 97 // Restores the drawing state after a call to Save*(). It is an error to |
98 // call Restore() more times than Save*(). | 98 // call Restore() more times than Save*(). |
99 virtual void Restore() = 0; | 99 virtual void Restore() = 0; |
100 | 100 |
101 // Returns true if the clip is non-empty. | 101 // Returns true if the clip is non-empty. |
102 virtual bool ClipRect(const gfx::Rect& rect) = 0; | 102 virtual bool ClipRect(const gfx::Rect& rect) = 0; |
103 | 103 |
104 virtual void Translate(const gfx::Point& point) = 0; | 104 virtual void Translate(const gfx::Point& point) = 0; |
105 | 105 |
106 // Wrapper function that takes integer arguments. | 106 virtual void Scale(int x_scale, int y_scale) = 0; |
107 virtual void ScaleInt(int x, int y) = 0; | |
108 | 107 |
109 // Fills the specified region with the specified color using a transfer | 108 // Fills the specified region with the specified color using a transfer |
110 // mode of SkXfermode::kSrcOver_Mode. | 109 // mode of SkXfermode::kSrcOver_Mode. |
111 virtual void FillRectInt(const SkColor& color, | 110 virtual void FillRectInt(const SkColor& color, |
112 int x, int y, int w, int h) = 0; | 111 int x, int y, int w, int h) = 0; |
113 | 112 |
114 // Fills the specified region with the specified color and mode | 113 // Fills the specified region with the specified color and mode |
115 virtual void FillRectInt(const SkColor& color, | 114 virtual void FillRectInt(const SkColor& color, |
116 int x, int y, int w, int h, | 115 int x, int y, int w, int h, |
117 SkXfermode::Mode mode) = 0; | 116 SkXfermode::Mode mode) = 0; |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 // Returns the rectangle that is invalid. | 246 // Returns the rectangle that is invalid. |
248 virtual gfx::Rect GetInvalidRect() const = 0; | 247 virtual gfx::Rect GetInvalidRect() const = 0; |
249 | 248 |
250 // Returns the underlying Canvas. | 249 // Returns the underlying Canvas. |
251 virtual Canvas* AsCanvas() = 0; | 250 virtual Canvas* AsCanvas() = 0; |
252 }; | 251 }; |
253 | 252 |
254 } // namespace gfx | 253 } // namespace gfx |
255 | 254 |
256 #endif // UI_GFX_CANVAS_H_ | 255 #endif // UI_GFX_CANVAS_H_ |
OLD | NEW |