Add overrides to SkAndroidSDKCanvas, update SkHwuiRenderer

We can not call android::uirenderer::DisplayListCanvas::reset()
after the object has been constructed (due to an assert), so remove
that call. Add two missing overrides to SkAndroidSDKCanvas:
onDrawAtlas() and onDrawImageNine().

BUG=skia:4216
R=djsollen@google.com

patch from issue 1377533003 at patchset 20001 (http://crrev.com/1377533003#ps20001)

Review URL: https://codereview.chromium.org/1369923003
This commit is contained in:
tomhudson 2015-10-01 08:02:22 -07:00 committed by Commit bot
parent 7a14b310d6
commit 458633496c
3 changed files with 29 additions and 3 deletions

View File

@ -248,12 +248,34 @@ void SkAndroidSDKCanvas::onDrawImageRect(const SkImage* image,
}
void SkAndroidSDKCanvas::onDrawPicture(const SkPicture* picture,
const SkMatrix* matrix,
const SkPaint* paint) {
const SkMatrix* matrix,
const SkPaint* paint) {
FILTER_PTR(paint);
fProxyTarget->drawPicture(picture, matrix, filteredPaint);
}
void SkAndroidSDKCanvas::onDrawAtlas(const SkImage* atlas,
const SkRSXform xform[],
const SkRect tex[],
const SkColor colors[],
int count,
SkXfermode::Mode mode,
const SkRect* cullRect,
const SkPaint* paint) {
FILTER_PTR(paint);
fProxyTarget->drawAtlas(atlas, xform, tex, colors, count, mode, cullRect,
filteredPaint);
}
void SkAndroidSDKCanvas::onDrawImageNine(const SkImage* image,
const SkIRect& center,
const SkRect& dst,
const SkPaint* paint) {
FILTER_PTR(paint);
fProxyTarget->drawImageNine(image, center, dst, filteredPaint);
}
void SkAndroidSDKCanvas::onDrawDrawable(SkDrawable* drawable, const SkMatrix* matrix) {
fProxyTarget->drawDrawable(drawable, matrix);
}

View File

@ -75,6 +75,11 @@ protected:
void onDrawImageRect(const SkImage*, const SkRect*, const SkRect&, const SkPaint*,
SrcRectConstraint) override;
void onDrawPicture(const SkPicture*, const SkMatrix*, const SkPaint*);
void onDrawAtlas(const SkImage*, const SkRSXform[], const SkRect[],
const SkColor[], int count, SkXfermode::Mode,
const SkRect* cull, const SkPaint*) override;
void onDrawImageNine(const SkImage*, const SkIRect& center,
const SkRect& dst, const SkPaint*) override;
// PASS THROUGH

View File

@ -61,7 +61,6 @@ void SkHwuiRenderer::initialize(SkISize size) {
}
SkCanvas* SkHwuiRenderer::prepareToDraw() {
this->canvas->reset(size.width(), size.height());
this->canvas->clipRect(0, 0, this->size.width(), this->size.height(),
SkRegion::Op::kReplace_Op);
return this->canvas->asSkCanvas();