Chromium Code Reviews| 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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 163 const FontList& font_list, | 163 const FontList& font_list, |
| 164 SkColor text_color, | 164 SkColor text_color, |
| 165 SkColor halo_color, | 165 SkColor halo_color, |
| 166 const Rect& display_rect, | 166 const Rect& display_rect, |
| 167 int flags); | 167 int flags); |
| 168 | 168 |
| 169 // Extracts an ImageSkiaRep from the contents of this canvas. | 169 // Extracts an ImageSkiaRep from the contents of this canvas. |
| 170 ImageSkiaRep ExtractImageRep() const; | 170 ImageSkiaRep ExtractImageRep() const; |
| 171 | 171 |
| 172 // Draws a dashed rectangle of the specified color. | 172 // Draws a dashed rectangle of the specified color. |
| 173 // DEPRECATED in favor of the RectF version below. | |
| 174 // TODO(funkysidd): Remove this (http://crbug.com/553726) | |
| 175 void DrawDashedRect(const Rect& rect, SkColor color); | |
| 176 | |
| 177 // Draws a dashed rectangle of the specified color. | |
| 178 void DrawDashedRect(const RectF& rect, SkColor color); | 173 void DrawDashedRect(const RectF& rect, SkColor color); |
| 179 | 174 |
| 180 // Unscales by the image scale factor (aka device scale factor), and returns | 175 // Unscales by the image scale factor (aka device scale factor), and returns |
| 181 // that factor. This is useful when callers want to draw directly in the | 176 // that factor. This is useful when callers want to draw directly in the |
| 182 // native scale. | 177 // native scale. |
| 183 float UndoDeviceScaleFactor(); | 178 float UndoDeviceScaleFactor(); |
| 184 | 179 |
| 185 // Saves a copy of the drawing state onto a stack, operating on this copy | 180 // Saves a copy of the drawing state onto a stack, operating on this copy |
| 186 // until a balanced call to Restore() is made. | 181 // until a balanced call to Restore() is made. |
| 187 void Save(); | 182 void Save(); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 232 // SkBlendMode::kSrcOver. | 227 // SkBlendMode::kSrcOver. |
| 233 void FillRect(const Rect& rect, SkColor color); | 228 void FillRect(const Rect& rect, SkColor color); |
| 234 | 229 |
| 235 // Fills |rect| with the specified |color| and |mode|. | 230 // Fills |rect| with the specified |color| and |mode|. |
| 236 void FillRect(const Rect& rect, SkColor color, SkBlendMode mode); | 231 void FillRect(const Rect& rect, SkColor color, SkBlendMode mode); |
| 237 | 232 |
| 238 // Draws a single pixel rect in the specified region with the specified | 233 // Draws a single pixel rect in the specified region with the specified |
| 239 // color, using a transfer mode of SkBlendMode::kSrcOver. | 234 // color, using a transfer mode of SkBlendMode::kSrcOver. |
| 240 // | 235 // |
| 241 // NOTE: if you need a single pixel line, use DrawLine. | 236 // NOTE: if you need a single pixel line, use DrawLine. |
| 242 // DEPRECATED in favor of the RectF version below. | |
| 243 // TODO(funkysidd): Remove this (http://crbug.com/553726) | |
| 244 void DrawRect(const Rect& rect, SkColor color); | |
|
Matt Giuca
2017/04/07 03:47:54
This function seems to still be used by chrome/bro
Uzair
2017/04/07 05:30:59
Done.
| |
| 245 | |
| 246 // Draws a single pixel rect in the specified region with the specified | |
| 247 // color, using a transfer mode of SkBlendMode::kSrcOver. | |
| 248 // | |
| 249 // NOTE: if you need a single pixel line, use DrawLine. | |
| 250 void DrawRect(const RectF& rect, SkColor color); | 237 void DrawRect(const RectF& rect, SkColor color); |
| 251 | 238 |
| 252 // Draws a single pixel rect in the specified region with the specified | 239 // Draws a single pixel rect in the specified region with the specified |
| 253 // color and transfer mode. | 240 // color and transfer mode. |
| 254 // | 241 // |
| 255 // NOTE: if you need a single pixel line, use DrawLine. | 242 // NOTE: if you need a single pixel line, use DrawLine. |
| 256 // DEPRECATED in favor of the RectF version below. | 243 // DEPRECATED in favor of the RectF version below. |
| 257 // TODO(funkysidd): Remove this (http://crbug.com/553726) | 244 // TODO(funkysidd): Remove this (http://crbug.com/553726) |
| 258 void DrawRect(const Rect& rect, SkColor color, SkBlendMode mode); | 245 void DrawRect(const Rect& rect, SkColor color, SkBlendMode mode); |
|
Matt Giuca
2017/04/07 03:47:54
This one doesn't seem to have any uses so can be r
Uzair
2017/04/07 05:30:59
Done.
| |
| 259 | 246 |
| 260 // Draws a single pixel rect in the specified region with the specified | 247 // Draws a single pixel rect in the specified region with the specified |
| 261 // color and transfer mode. | 248 // color and transfer mode. |
| 262 // | 249 // |
| 263 // NOTE: if you need a single pixel line, use DrawLine. | 250 // NOTE: if you need a single pixel line, use DrawLine. |
| 264 void DrawRect(const RectF& rect, SkColor color, SkBlendMode mode); | 251 void DrawRect(const RectF& rect, SkColor color, SkBlendMode mode); |
| 265 | 252 |
| 266 // Draws the given rectangle with the given |flags| parameters. | 253 // Draws the given rectangle with the given |flags| parameters. |
| 267 // DEPRECATED in favor of the RectF version below. | 254 // DEPRECATED in favor of the RectF version below. |
| 268 // TODO(funkysidd): Remove this (http://crbug.com/553726) | 255 // TODO(funkysidd): Remove this (http://crbug.com/553726) |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 516 base::Optional<SkBitmap> bitmap_; | 503 base::Optional<SkBitmap> bitmap_; |
| 517 base::Optional<cc::SkiaPaintCanvas> owned_canvas_; | 504 base::Optional<cc::SkiaPaintCanvas> owned_canvas_; |
| 518 cc::PaintCanvas* canvas_; | 505 cc::PaintCanvas* canvas_; |
| 519 | 506 |
| 520 DISALLOW_COPY_AND_ASSIGN(Canvas); | 507 DISALLOW_COPY_AND_ASSIGN(Canvas); |
| 521 }; | 508 }; |
| 522 | 509 |
| 523 } // namespace gfx | 510 } // namespace gfx |
| 524 | 511 |
| 525 #endif // UI_GFX_CANVAS_H_ | 512 #endif // UI_GFX_CANVAS_H_ |
| OLD | NEW |