Skip to content

Commit de26719

Browse files
author
Jean-Baptiste Queru
committed
Tweak setViewport stuff for fwd-compat
Change-Id: I532336eced54544115dfd47d5557cc77bafdfc87
1 parent 258f32e commit de26719

File tree

2 files changed

+3
-18
lines changed

2 files changed

+3
-18
lines changed

core/jni/android/graphics/Canvas.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -73,20 +73,6 @@ class SkCanvasGlue {
7373
static jboolean isOpaque(JNIEnv* env, jobject jcanvas) {
7474
NPE_CHECK_RETURN_ZERO(env, jcanvas);
7575
SkCanvas* canvas = GraphicsJNI::getNativeCanvas(env, jcanvas);
76-
77-
/*
78-
Currently we cannot support transparency in GL-based canvas' at
79-
the view level. Therefore we cannot base our answer on the device's
80-
bitmap, but need to hard-code the answer. If we relax this
81-
limitation in views, we can simplify the following code as well.
82-
83-
Use the getViewport() call to find out if we're gl-based...
84-
*/
85-
if (canvas->getViewport(NULL)) {
86-
return true;
87-
}
88-
89-
// normal technique, rely on the device's bitmap for the answer
9076
return canvas->getDevice()->accessBitmap(false).isOpaque();
9177
}
9278

@@ -104,7 +90,6 @@ class SkCanvasGlue {
10490

10591
static void setViewport(JNIEnv* env, jobject, SkCanvas* canvas,
10692
int width, int height) {
107-
canvas->setViewport(width, height);
10893
}
10994

11095
static void setBitmap(JNIEnv* env, jobject, SkCanvas* canvas,

core/jni/android/graphics/NinePatchImpl.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,9 @@ void NinePatch_Draw(SkCanvas* canvas, const SkRect& bounds,
116116
paint = &defaultPaint;
117117
}
118118

119-
// if our canvas is GL, draw this as a mesh, which will be faster than
120-
// in parts (which is faster for raster)
121-
if (canvas && canvas->getViewport(NULL)) {
119+
// if our SkCanvas were back by GL we should enable this and draw this as
120+
// a mesh, which will be faster in most cases.
121+
if (false) {
122122
SkNinePatch::DrawMesh(canvas, bounds, bitmap,
123123
chunk.xDivs, chunk.numXDivs,
124124
chunk.yDivs, chunk.numYDivs,

0 commit comments

Comments
 (0)