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

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

Issue 8476019: ui/gfx: Convert Canvas::DrawRectInt() to use gfx::Rect. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address Peter's review Created 9 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) 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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 virtual void FillRect(const SkColor& color, const gfx::Rect& rect) = 0; 111 virtual void FillRect(const SkColor& color, const gfx::Rect& rect) = 0;
112 112
113 // Fills the specified region with the specified color and mode. 113 // Fills the specified region with the specified color and mode.
114 virtual void FillRect(const SkColor& color, 114 virtual void FillRect(const SkColor& color,
115 const gfx::Rect& rect, 115 const gfx::Rect& rect,
116 SkXfermode::Mode mode) = 0; 116 SkXfermode::Mode mode) = 0;
117 117
118 // Fills the specified region with the specified brush. 118 // Fills the specified region with the specified brush.
119 virtual void FillRect(const gfx::Brush* brush, const gfx::Rect& rect) = 0; 119 virtual void FillRect(const gfx::Brush* brush, const gfx::Rect& rect) = 0;
120 120
121 // Draws the given rectangle with the given paint's parameters.
Peter Kasting 2011/11/21 19:26:03 Nit: I'd leave both the declaration and definition
tfarina 2011/11/22 18:39:01 Done.
122 virtual void DrawRect(const gfx::Rect& rect, const SkPaint& paint) = 0;
123
121 // Draws a single pixel rect in the specified region with the specified 124 // Draws a single pixel rect in the specified region with the specified
122 // color, using a transfer mode of SkXfermode::kSrcOver_Mode. 125 // color, using a transfer mode of SkXfermode::kSrcOver_Mode.
123 // 126 //
124 // NOTE: if you need a single pixel line, use DrawLineInt. 127 // NOTE: if you need a single pixel line, use DrawLineInt.
125 virtual void DrawRectInt(const SkColor& color, 128 virtual void DrawRect(const gfx::Rect& rect, const SkColor& color) = 0;
126 int x, int y, int w, int h) = 0;
127 129
128 // Draws a single pixel rect in the specified region with the specified 130 // Draws a single pixel rect in the specified region with the specified
129 // color and transfer mode. 131 // color and transfer mode.
130 // 132 //
131 // NOTE: if you need a single pixel line, use DrawLineInt. 133 // NOTE: if you need a single pixel line, use DrawLineInt.
132 virtual void DrawRectInt(const SkColor& color, 134 virtual void DrawRect(const gfx::Rect& rect,
133 int x, int y, int w, int h, 135 const SkColor& color,
134 SkXfermode::Mode mode) = 0; 136 SkXfermode::Mode mode) = 0;
135
136 // Draws the given rectangle with the given paint's parameters.
137 virtual void DrawRectInt(int x, int y, int w, int h,
138 const SkPaint& paint) = 0;
139 137
140 // Draws a single pixel line with the specified color. 138 // Draws a single pixel line with the specified color.
141 virtual void DrawLineInt(const SkColor& color, 139 virtual void DrawLineInt(const SkColor& color,
142 int x1, int y1, 140 int x1, int y1,
143 int x2, int y2) = 0; 141 int x2, int y2) = 0;
144 142
145 // Draws a bitmap with the origin at the specified location. The upper left 143 // Draws a bitmap with the origin at the specified location. The upper left
146 // corner of the bitmap is rendered at the specified location. 144 // corner of the bitmap is rendered at the specified location.
147 virtual void DrawBitmapInt(const SkBitmap& bitmap, int x, int y) = 0; 145 virtual void DrawBitmapInt(const SkBitmap& bitmap, int x, int y) = 0;
148 146
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 // Returns the rectangle that is invalid. 243 // Returns the rectangle that is invalid.
246 virtual gfx::Rect GetInvalidRect() const = 0; 244 virtual gfx::Rect GetInvalidRect() const = 0;
247 245
248 // Returns the underlying Canvas. 246 // Returns the underlying Canvas.
249 virtual Canvas* AsCanvas() = 0; 247 virtual Canvas* AsCanvas() = 0;
250 }; 248 };
251 249
252 } // namespace gfx 250 } // namespace gfx
253 251
254 #endif // UI_GFX_CANVAS_H_ 252 #endif // UI_GFX_CANVAS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698