Assorted Android fixes

Ran into these while trying to follow https://skia.org/user/quick/android.

R=reed@google.com,djsollen@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2395273002

Review-Url: https://codereview.chromium.org/2395273002
This commit is contained in:
fmalita 2016-10-06 14:37:23 -07:00 committed by Commit bot
parent 388faa0fb9
commit 2766cc567d
2 changed files with 12 additions and 14 deletions

View File

@ -25,7 +25,7 @@ void CheckShader(SkPaint* paint) {
return;
}
if (shader->isABitmap()) {
if (shader->isAImage()) {
return;
}
if (shader->asACompose(nullptr)) {
@ -46,11 +46,9 @@ void Filter(SkPaint* paint) {
flags &= ~SkPaint::kLCDRenderText_Flag;
paint->setFlags(flags);
// Android doesn't support Xfermodes above kLighten_Mode
SkXfermode::Mode mode;
SkXfermode::AsMode(paint->getXfermode(), &mode);
if (mode > SkXfermode::kLighten_Mode) {
paint->setXfermode(nullptr);
// Android doesn't support blend modes above kLighten_Mode
if (paint->getBlendMode() > SkBlendMode::kLighten) {
paint->setBlendMode(SkBlendMode::kSrcOver);
}
// Force bilinear scaling or none
@ -344,24 +342,24 @@ void SkAndroidSDKCanvas::didSetMatrix(const SkMatrix& m) {
}
void SkAndroidSDKCanvas::onClipRect(const SkRect& rect,
SkRegion::Op op,
ClipOp op,
ClipEdgeStyle style) {
fProxyTarget->clipRect(rect, op, style);
}
void SkAndroidSDKCanvas::onClipRRect(const SkRRect& rrect,
SkRegion::Op op,
ClipOp op,
ClipEdgeStyle style) {
fProxyTarget->clipRRect(rrect, op, style);
}
void SkAndroidSDKCanvas::onClipPath(const SkPath& path,
SkRegion::Op op,
ClipOp op,
ClipEdgeStyle style) {
fProxyTarget->clipPath(path, op, style);
}
void SkAndroidSDKCanvas::onClipRegion(const SkRegion& region, SkRegion::Op op) {
void SkAndroidSDKCanvas::onClipRegion(const SkRegion& region, ClipOp op) {
fProxyTarget->clipRegion(region, op);
}

View File

@ -100,10 +100,10 @@ protected:
void didRestore() override;
void didConcat(const SkMatrix&) override;
void didSetMatrix(const SkMatrix&) override;
void onClipRect(const SkRect&, SkRegion::Op, ClipEdgeStyle) override;
void onClipRRect(const SkRRect&, SkRegion::Op, ClipEdgeStyle) override;
void onClipPath(const SkPath&, SkRegion::Op, ClipEdgeStyle) override;
void onClipRegion(const SkRegion&, SkRegion::Op) override;
void onClipRect(const SkRect&, ClipOp, ClipEdgeStyle) override;
void onClipRRect(const SkRRect&, ClipOp, ClipEdgeStyle) override;
void onClipPath(const SkPath&, ClipOp, ClipEdgeStyle) override;
void onClipRegion(const SkRegion&, ClipOp) override;
void onDiscard() override;
protected: