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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 void SaveLayerAlpha(uint8 alpha); | 194 void SaveLayerAlpha(uint8 alpha); |
195 void SaveLayerAlpha(uint8 alpha, const Rect& layer_bounds); | 195 void SaveLayerAlpha(uint8 alpha, const Rect& layer_bounds); |
196 | 196 |
197 // Restores the drawing state after a call to Save*(). It is an error to | 197 // Restores the drawing state after a call to Save*(). It is an error to |
198 // call Restore() more times than Save*(). | 198 // call Restore() more times than Save*(). |
199 void Restore(); | 199 void Restore(); |
200 | 200 |
201 // Adds |rect| to the current clip. | 201 // Adds |rect| to the current clip. |
202 void ClipRect(const Rect& rect); | 202 void ClipRect(const Rect& rect); |
203 | 203 |
204 // Adds |path| to the current clip. | 204 // Adds |path| to the current clip. |do_anti_alias| is true if the clip |
205 void ClipPath(const SkPath& path); | 205 // should be antialiased. |
| 206 void ClipPath(const SkPath& path, bool do_anti_alias); |
206 | 207 |
207 // Returns true if the current clip is empty. | 208 // Returns true if the current clip is empty. |
208 bool IsClipEmpty() const; | 209 bool IsClipEmpty() const; |
209 | 210 |
210 // Returns the bounds of the current clip (in local coordinates) in the | 211 // Returns the bounds of the current clip (in local coordinates) in the |
211 // |bounds| parameter, and returns true if it is non empty. | 212 // |bounds| parameter, and returns true if it is non empty. |
212 bool GetClipBounds(Rect* bounds); | 213 bool GetClipBounds(Rect* bounds); |
213 | 214 |
214 void Translate(const Vector2d& offset); | 215 void Translate(const Vector2d& offset); |
215 | 216 |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
467 | 468 |
468 skia::RefPtr<skia::PlatformCanvas> owned_canvas_; | 469 skia::RefPtr<skia::PlatformCanvas> owned_canvas_; |
469 SkCanvas* canvas_; | 470 SkCanvas* canvas_; |
470 | 471 |
471 DISALLOW_COPY_AND_ASSIGN(Canvas); | 472 DISALLOW_COPY_AND_ASSIGN(Canvas); |
472 }; | 473 }; |
473 | 474 |
474 } // namespace gfx | 475 } // namespace gfx |
475 | 476 |
476 #endif // UI_GFX_CANVAS_H_ | 477 #endif // UI_GFX_CANVAS_H_ |
OLD | NEW |