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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 virtual void Scale(int x_scale, int y_scale) = 0; | 106 virtual void Scale(int x_scale, int y_scale) = 0; |
107 | 107 |
108 // Fills the specified region with the specified color using a transfer | 108 // Fills the specified region with the specified color using a transfer |
109 // mode of SkXfermode::kSrcOver_Mode. | 109 // mode of SkXfermode::kSrcOver_Mode. |
110 virtual void FillRectInt(const SkColor& color, | 110 virtual void FillRect(const SkColor& color, const gfx::Rect& rect) = 0; |
111 int x, int y, int w, int h) = 0; | |
112 | 111 |
113 // Fills the specified region with the specified color and mode | 112 // Fills the specified region with the specified color and mode. |
114 virtual void FillRectInt(const SkColor& color, | 113 virtual void FillRect(const SkColor& color, |
115 int x, int y, int w, int h, | 114 const gfx::Rect& rect, |
116 SkXfermode::Mode mode) = 0; | 115 SkXfermode::Mode mode) = 0; |
117 | 116 |
118 // Fills the specified region with the specified brush. | 117 // Fills the specified region with the specified brush. |
119 virtual void FillRectInt(const gfx::Brush* brush, | 118 virtual void FillRect(const gfx::Brush* brush, const gfx::Rect& rect) = 0; |
120 int x, int y, int w, int h) = 0; | |
121 | 119 |
122 // Draws a single pixel rect in the specified region with the specified | 120 // Draws a single pixel rect in the specified region with the specified |
123 // color, using a transfer mode of SkXfermode::kSrcOver_Mode. | 121 // color, using a transfer mode of SkXfermode::kSrcOver_Mode. |
124 // | 122 // |
125 // NOTE: if you need a single pixel line, use DrawLineInt. | 123 // NOTE: if you need a single pixel line, use DrawLineInt. |
126 virtual void DrawRectInt(const SkColor& color, | 124 virtual void DrawRectInt(const SkColor& color, |
127 int x, int y, int w, int h) = 0; | 125 int x, int y, int w, int h) = 0; |
128 | 126 |
129 // Draws a single pixel rect in the specified region with the specified | 127 // Draws a single pixel rect in the specified region with the specified |
130 // color and transfer mode. | 128 // color and transfer mode. |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 // Returns the rectangle that is invalid. | 244 // Returns the rectangle that is invalid. |
247 virtual gfx::Rect GetInvalidRect() const = 0; | 245 virtual gfx::Rect GetInvalidRect() const = 0; |
248 | 246 |
249 // Returns the underlying Canvas. | 247 // Returns the underlying Canvas. |
250 virtual Canvas* AsCanvas() = 0; | 248 virtual Canvas* AsCanvas() = 0; |
251 }; | 249 }; |
252 | 250 |
253 } // namespace gfx | 251 } // namespace gfx |
254 | 252 |
255 #endif // UI_GFX_CANVAS_H_ | 253 #endif // UI_GFX_CANVAS_H_ |
OLD | NEW |