OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 GFX_CANVAS_H_ | 5 #ifndef GFX_CANVAS_H_ |
6 #define GFX_CANVAS_H_ | 6 #define GFX_CANVAS_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
| 11 #include "base/string16.h" |
11 #include "gfx/native_widget_types.h" | 12 #include "gfx/native_widget_types.h" |
12 // TODO(beng): remove this include when we no longer depend on SkTypes. | 13 // TODO(beng): remove this include when we no longer depend on SkTypes. |
13 #include "skia/ext/platform_canvas.h" | 14 #include "skia/ext/platform_canvas.h" |
14 | 15 |
15 namespace gfx { | 16 namespace gfx { |
16 | 17 |
17 class Brush; | 18 class Brush; |
18 class CanvasSkia; | 19 class CanvasSkia; |
19 class Font; | 20 class Font; |
20 class Point; | 21 class Point; |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 bool filter) = 0; | 165 bool filter) = 0; |
165 virtual void DrawBitmapInt(const SkBitmap& bitmap, | 166 virtual void DrawBitmapInt(const SkBitmap& bitmap, |
166 int src_x, int src_y, int src_w, int src_h, | 167 int src_x, int src_y, int src_w, int src_h, |
167 int dest_x, int dest_y, int dest_w, int dest_h, | 168 int dest_x, int dest_y, int dest_w, int dest_h, |
168 bool filter, | 169 bool filter, |
169 const SkPaint& paint) = 0; | 170 const SkPaint& paint) = 0; |
170 | 171 |
171 // Draws text with the specified color, font and location. The text is | 172 // Draws text with the specified color, font and location. The text is |
172 // aligned to the left, vertically centered, clipped to the region. If the | 173 // aligned to the left, vertically centered, clipped to the region. If the |
173 // text is too big, it is truncated and '...' is added to the end. | 174 // text is too big, it is truncated and '...' is added to the end. |
174 virtual void DrawStringInt(const std::wstring& text, const | 175 virtual void DrawStringInt(const string16& text, const |
175 gfx::Font& font, | 176 gfx::Font& font, |
176 const SkColor& color, | 177 const SkColor& color, |
177 int x, int y, int w, int h) = 0; | 178 int x, int y, int w, int h) = 0; |
178 virtual void DrawStringInt(const std::wstring& text, | 179 virtual void DrawStringInt(const string16& text, |
179 const gfx::Font& font, | 180 const gfx::Font& font, |
180 const SkColor& color, | 181 const SkColor& color, |
181 const gfx::Rect& display_rect) = 0; | 182 const gfx::Rect& display_rect) = 0; |
182 | 183 |
183 // Draws text with the specified color, font and location. The last argument | 184 // Draws text with the specified color, font and location. The last argument |
184 // specifies flags for how the text should be rendered. It can be one of | 185 // specifies flags for how the text should be rendered. It can be one of |
185 // TEXT_ALIGN_CENTER, TEXT_ALIGN_RIGHT or TEXT_ALIGN_LEFT. | 186 // TEXT_ALIGN_CENTER, TEXT_ALIGN_RIGHT or TEXT_ALIGN_LEFT. |
186 virtual void DrawStringInt(const std::wstring& text, | 187 virtual void DrawStringInt(const string16& text, |
187 const gfx::Font& font, | 188 const gfx::Font& font, |
188 const SkColor& color, | 189 const SkColor& color, |
189 int x, int y, int w, int h, | 190 int x, int y, int w, int h, |
190 int flags) = 0; | 191 int flags) = 0; |
191 | 192 |
192 // Draws a dotted gray rectangle used for focus purposes. | 193 // Draws a dotted gray rectangle used for focus purposes. |
193 virtual void DrawFocusRect(int x, int y, int width, int height) = 0; | 194 virtual void DrawFocusRect(int x, int y, int width, int height) = 0; |
194 | 195 |
195 // Tiles the image in the specified region. | 196 // Tiles the image in the specified region. |
196 virtual void TileImageInt(const SkBitmap& bitmap, | 197 virtual void TileImageInt(const SkBitmap& bitmap, |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 // Returns the rectangle that is invalid. | 229 // Returns the rectangle that is invalid. |
229 virtual gfx::Rect GetInvalidRect() const = 0; | 230 virtual gfx::Rect GetInvalidRect() const = 0; |
230 | 231 |
231 // Returns the underlying Canvas. | 232 // Returns the underlying Canvas. |
232 virtual Canvas* AsCanvas() = 0; | 233 virtual Canvas* AsCanvas() = 0; |
233 }; | 234 }; |
234 | 235 |
235 } // namespace gfx; | 236 } // namespace gfx; |
236 | 237 |
237 #endif // GFX_CANVAS_H_ | 238 #endif // GFX_CANVAS_H_ |
OLD | NEW |