#include "cc/base/cc_export.h"
#include "cc/base/region.h"
#include "skia/ext/refptr.h"
-#include "third_party/skia/include/core/SkTileGridPicture.h"
+#include "third_party/skia/include/core/SkBBHFactory.h"
+#include "third_party/skia/include/core/SkPicture.h"
+#include "third_party/skia/include/record/SkRecording.h"
#include "ui/gfx/rect.h"
class SkPixelRef;
typedef std::vector<SkPixelRef*> PixelRefs;
typedef base::hash_map<PixelRefMapKey, PixelRefs> PixelRefMap;
+ enum RecordingMode {
+ RECORD_NORMALLY,
+ RECORD_WITH_SK_NULL_CANVAS,
+ RECORD_WITH_PAINTING_DISABLED,
+ RECORD_WITH_SKRECORD,
+ RECORDING_MODE_COUNT, // Must be the last entry.
+ };
+
static scoped_refptr<Picture> Create(
const gfx::Rect& layer_rect,
ContentLayerClient* client,
- const SkTileGridPicture::TileGridInfo& tile_grid_info,
+ const SkTileGridFactory::TileGridInfo& tile_grid_info,
bool gather_pixels_refs,
- int num_raster_threads);
+ int num_raster_threads,
+ RecordingMode recording_mode);
static scoped_refptr<Picture> CreateFromValue(const base::Value* value);
static scoped_refptr<Picture> CreateFromSkpValue(const base::Value* value);
// Has Record() been called yet?
bool HasRecording() const { return picture_.get() != NULL; }
- // Apply this scale and raster the negated region into the canvas. See comment
- // in PicturePileImpl::RasterCommon for explanation on negated content region.
+ bool IsSuitableForGpuRasterization() const;
+
+ // Apply this scale and raster the negated region into the canvas.
+ // |negated_content_region| specifies the region to be clipped out of the
+ // raster operation, i.e., the parts of the canvas which will not get drawn
+ // to.
int Raster(SkCanvas* canvas,
SkDrawPictureCallback* callback,
const Region& negated_content_region,
// Record a paint operation. To be able to safely use this SkPicture for
// playback on a different thread this can only be called once.
void Record(ContentLayerClient* client,
- const SkTileGridPicture::TileGridInfo& tile_grid_info);
+ const SkTileGridFactory::TileGridInfo& tile_grid_info,
+ RecordingMode recording_mode);
// Gather pixel refs from recording.
- void GatherPixelRefs(const SkTileGridPicture::TileGridInfo& tile_grid_info);
+ void GatherPixelRefs(const SkTileGridFactory::TileGridInfo& tile_grid_info);
gfx::Rect layer_rect_;
gfx::Rect opaque_rect_;
skia::RefPtr<SkPicture> picture_;
+ scoped_ptr<const EXPERIMENTAL::SkPlayback> playback_;
typedef std::vector<scoped_refptr<Picture> > PictureVector;
PictureVector clones_;