GatherPixelRefDevice(int width, int height, PixelRefSet* prset) {
fSize.set(width, height);
- fEmptyBitmap.setConfig(SkBitmap::kNo_Config, width, height);
+ fEmptyBitmap.setInfo(SkImageInfo::MakeUnknown(width, height));
fPRSet = prset;
}
- virtual uint32_t getDeviceCapabilities() SK_OVERRIDE { return 0; }
- virtual int width() const SK_OVERRIDE { return fSize.width(); }
- virtual int height() const SK_OVERRIDE { return fSize.height(); }
- virtual bool isOpaque() const SK_OVERRIDE { return false; }
- virtual SkBitmap::Config config() const SK_OVERRIDE {
- return SkBitmap::kNo_Config;
+ virtual SkImageInfo imageInfo() const SK_OVERRIDE {
+ return SkImageInfo::MakeUnknown(fSize.width(), fSize.height());
}
virtual GrRenderTarget* accessRenderTarget() SK_OVERRIDE { return NULL; }
virtual bool filterTextFlags(const SkPaint& paint, TextFlags*) SK_OVERRIDE {
virtual void unlockPixels() SK_OVERRIDE { nothing_to_do(); }
virtual bool allowImageFilter(const SkImageFilter*) SK_OVERRIDE { return false; }
virtual bool canHandleImageFilter(const SkImageFilter*) SK_OVERRIDE { return false; }
- virtual bool filterImage(const SkImageFilter*, const SkBitmap&, const SkMatrix&,
+ virtual bool filterImage(const SkImageFilter*, const SkBitmap&, const SkImageFilter::Context&,
SkBitmap* result, SkIPoint* offset) SK_OVERRIDE {
return false;
}
virtual void clear(SkColor color) SK_OVERRIDE {
nothing_to_do();
}
- virtual void writePixels(const SkBitmap& bitmap, int x, int y,
- SkCanvas::Config8888 config8888) SK_OVERRIDE {
- not_supported();
- }
virtual void drawPaint(const SkDraw&, const SkPaint& paint) SK_OVERRIDE {
this->addBitmapFromPaint(paint);
virtual void drawBitmap(const SkDraw&, const SkBitmap& bitmap,
const SkMatrix&, const SkPaint& paint) SK_OVERRIDE {
this->addBitmap(bitmap);
- if (SkBitmap::kA8_Config == bitmap.config()) {
+ if (kAlpha_8_SkColorType == bitmap.colorType()) {
this->addBitmapFromPaint(paint);
}
}
const SkPaint& paint,
SkCanvas::DrawBitmapRectFlags flags) SK_OVERRIDE {
this->addBitmap(bitmap);
- if (SkBitmap::kA8_Config == bitmap.config()) {
+ if (kAlpha_8_SkColorType == bitmap.colorType()) {
this->addBitmapFromPaint(paint);
}
}
}
protected:
- virtual bool onReadPixels(const SkBitmap& bitmap,
- int x, int y,
- SkCanvas::Config8888 config8888) SK_OVERRIDE {
- not_supported();
- return false;
- }
-
virtual void replaceBitmapBackendForRasterSurface(const SkBitmap&) SK_OVERRIDE {
not_supported();
}
- virtual SkBaseDevice* onCreateCompatibleDevice(SkBitmap::Config config,
- int width, int height,
- bool isOpaque,
- Usage usage) SK_OVERRIDE {
+ virtual SkBaseDevice* onCreateDevice(const SkImageInfo& info, Usage usage) SK_OVERRIDE {
// we expect to only get called via savelayer, in which case it is fine.
SkASSERT(kSaveLayer_Usage == usage);
- return SkNEW_ARGS(GatherPixelRefDevice, (width, height, fPRSet));
+ return SkNEW_ARGS(GatherPixelRefDevice, (info.width(), info.height(), fPRSet));
}
virtual void flush() SK_OVERRIDE {}
typedef SkBaseDevice INHERITED;
};
-SkData* SkPictureUtils::GatherPixelRefs(SkPicture* pict, const SkRect& area) {
+SkData* SkPictureUtils::GatherPixelRefs(const SkPicture* pict, const SkRect& area) {
if (NULL == pict) {
return NULL;
}
SkNoSaveLayerCanvas canvas(&device);
canvas.clipRect(area, SkRegion::kIntersect_Op, false);
- canvas.drawPicture(*pict);
+ canvas.drawPicture(pict);
SkData* data = NULL;
int count = array.count();