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 <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 | 184 |
185 // Returns true if the current clip is empty. | 185 // Returns true if the current clip is empty. |
186 bool IsClipEmpty() const; | 186 bool IsClipEmpty() const; |
187 | 187 |
188 // Returns the bounds of the current clip (in local coordinates) in the | 188 // Returns the bounds of the current clip (in local coordinates) in the |
189 // |bounds| parameter, and returns true if it is non empty. | 189 // |bounds| parameter, and returns true if it is non empty. |
190 bool GetClipBounds(Rect* bounds); | 190 bool GetClipBounds(Rect* bounds); |
191 | 191 |
192 void Translate(const Vector2d& offset); | 192 void Translate(const Vector2d& offset); |
193 | 193 |
194 void Scale(int x_scale, int y_scale); | 194 void Scale(float x_scale, float y_scale); |
195 | 195 |
196 // Fills the entire canvas' bitmap (restricted to current clip) with | 196 // Fills the entire canvas' bitmap (restricted to current clip) with |
197 // specified |color| using a transfer mode of SkBlendMode::kSrcOver. | 197 // specified |color| using a transfer mode of SkBlendMode::kSrcOver. |
198 void DrawColor(SkColor color); | 198 void DrawColor(SkColor color); |
199 | 199 |
200 // Fills the entire canvas' bitmap (restricted to current clip) with | 200 // Fills the entire canvas' bitmap (restricted to current clip) with |
201 // specified |color| and |mode|. | 201 // specified |color| and |mode|. |
202 void DrawColor(SkColor color, SkBlendMode mode); | 202 void DrawColor(SkColor color, SkBlendMode mode); |
203 | 203 |
204 // Fills |rect| with |color| using a transfer mode of | 204 // Fills |rect| with |color| using a transfer mode of |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
466 base::Optional<SkBitmap> bitmap_; | 466 base::Optional<SkBitmap> bitmap_; |
467 base::Optional<cc::SkiaPaintCanvas> owned_canvas_; | 467 base::Optional<cc::SkiaPaintCanvas> owned_canvas_; |
468 cc::PaintCanvas* canvas_; | 468 cc::PaintCanvas* canvas_; |
469 | 469 |
470 DISALLOW_COPY_AND_ASSIGN(Canvas); | 470 DISALLOW_COPY_AND_ASSIGN(Canvas); |
471 }; | 471 }; |
472 | 472 |
473 } // namespace gfx | 473 } // namespace gfx |
474 | 474 |
475 #endif // UI_GFX_CANVAS_H_ | 475 #endif // UI_GFX_CANVAS_H_ |
OLD | NEW |