Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(217)

Side by Side Diff: ui/gfx/canvas.h

Issue 11269022: Add Vector2d classes that represent offsets, instead of using Point. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: RenderText fixup Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 bool ClipRect(const gfx::Rect& rect); 189 bool ClipRect(const gfx::Rect& rect);
190 190
191 // Adds |path| to the current clip. Returns true if the resulting clip is 191 // Adds |path| to the current clip. Returns true if the resulting clip is
192 // non-empty. 192 // non-empty.
193 bool ClipPath(const SkPath& path); 193 bool ClipPath(const SkPath& path);
194 194
195 // Returns the bounds of the current clip (in local coordinates) in the 195 // Returns the bounds of the current clip (in local coordinates) in the
196 // |bounds| parameter, and returns true if it is non empty. 196 // |bounds| parameter, and returns true if it is non empty.
197 bool GetClipBounds(gfx::Rect* bounds); 197 bool GetClipBounds(gfx::Rect* bounds);
198 198
199 void Translate(const gfx::Point& point); 199 void Translate(const gfx::Vector2d& offset);
200 200
201 void Scale(int x_scale, int y_scale); 201 void Scale(int x_scale, int y_scale);
202 202
203 // Fills the entire canvas' bitmap (restricted to current clip) with 203 // Fills the entire canvas' bitmap (restricted to current clip) with
204 // specified |color| using a transfer mode of SkXfermode::kSrcOver_Mode. 204 // specified |color| using a transfer mode of SkXfermode::kSrcOver_Mode.
205 void DrawColor(SkColor color); 205 void DrawColor(SkColor color);
206 206
207 // Fills the entire canvas' bitmap (restricted to current clip) with 207 // Fills the entire canvas' bitmap (restricted to current clip) with
208 // specified |color| and |mode|. 208 // specified |color| and |mode|.
209 void DrawColor(SkColor color, SkXfermode::Mode mode); 209 void DrawColor(SkColor color, SkXfermode::Mode mode);
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 403
404 scoped_ptr<skia::PlatformCanvas> owned_canvas_; 404 scoped_ptr<skia::PlatformCanvas> owned_canvas_;
405 SkCanvas* canvas_; 405 SkCanvas* canvas_;
406 406
407 DISALLOW_COPY_AND_ASSIGN(Canvas); 407 DISALLOW_COPY_AND_ASSIGN(Canvas);
408 }; 408 };
409 409
410 } // namespace gfx 410 } // namespace gfx
411 411
412 #endif // UI_GFX_CANVAS_H_ 412 #endif // UI_GFX_CANVAS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698