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

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

Issue 2877483003: Implements core logic for Pixel Canvas (Closed)
Patch Set: Update unittests for RasterSource Created 3 years, 6 months 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
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 <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
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);
oshima 2017/06/15 22:59:13 Can you land this fix separately?
malaykeshav 2017/06/16 20:41:58 This is required only for Pixel canvas to scale wi
oshima 2017/06/17 00:55:45 I mean this isn't just a bug that we need to fix a
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
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698