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

Unified Diff: cc/raster/raster_source.h

Issue 2563743004: [3/5] Add translated rasterization support for RasterBuffer & below (Closed)
Patch Set: rebase & fix last nits Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/raster/raster_buffer_provider_unittest.cc ('k') | cc/raster/raster_source.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/raster/raster_source.h
diff --git a/cc/raster/raster_source.h b/cc/raster/raster_source.h
index ff9d0f24938893c72b5ef458db86cff9cd1961c7..b6292c5b8052fb1994ac4105accfa53e77c4d66e 100644
--- a/cc/raster/raster_source.h
+++ b/cc/raster/raster_source.h
@@ -19,6 +19,10 @@
#include "third_party/skia/include/core/SkPicture.h"
#include "ui/gfx/color_space.h"
+namespace gfx {
+class AxisTransform2d;
+} // namespace gfx
+
namespace cc {
class DisplayItemList;
class DrawImage;
@@ -54,12 +58,20 @@ class CC_EXPORT RasterSource : public base::RefCountedThreadSafe<RasterSource> {
const RecordingSource* other,
bool can_use_lcd_text);
- // TODO(trchen): Deprecated.
+ // Helper function to apply a few common operations before passing the canvas
+ // to the shorter version. This is useful for rastering into tiles.
+ // canvas is expected to be backed by a tile, with a default state.
+ // raster_transform will be applied to the display list, rastering the list
+ // into the "content space".
+ // canvas_bitmap_rect defines the extent of the tile in the content space,
+ // i.e. contents in the rect will be cropped and translated onto the canvas.
+ // canvas_playback_rect can be used to replay only part of the recording in,
+ // the content space, so only a sub-rect of the tile gets rastered.
void PlaybackToCanvas(SkCanvas* canvas,
const gfx::ColorSpace& canvas_color_space,
const gfx::Rect& canvas_bitmap_rect,
const gfx::Rect& canvas_playback_rect,
- float contents_scale,
+ const gfx::AxisTransform2d& raster_transform,
const PlaybackSettings& settings) const;
// Raster this RasterSource into the given canvas. Canvas states such as
« no previous file with comments | « cc/raster/raster_buffer_provider_unittest.cc ('k') | cc/raster/raster_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698