Updates resulting from the Skia merge (revision 1327)

Change-Id: I1d2cecbad6c30e6ebc9579093404742f17e14e84
This commit is contained in:
Derek Sollenberger
2011-05-16 13:09:42 -04:00
committed by Jean-Baptiste Queru
parent c031afc8e9
commit f11c52d246
3 changed files with 7 additions and 22 deletions

View File

@@ -72,20 +72,6 @@ public:
static jboolean isOpaque(JNIEnv* env, jobject jcanvas) { static jboolean isOpaque(JNIEnv* env, jobject jcanvas) {
NPE_CHECK_RETURN_ZERO(env, jcanvas); NPE_CHECK_RETURN_ZERO(env, jcanvas);
SkCanvas* canvas = GraphicsJNI::getNativeCanvas(env, jcanvas); SkCanvas* canvas = GraphicsJNI::getNativeCanvas(env, jcanvas);
/*
Currently we cannot support transparency in GL-based canvas' at
the view level. Therefore we cannot base our answer on the device's
bitmap, but need to hard-code the answer. If we relax this
limitation in views, we can simplify the following code as well.
Use the getViewport() call to find out if we're gl-based...
*/
if (canvas->getViewport(NULL)) {
return true;
}
// normal technique, rely on the device's bitmap for the answer
return canvas->getDevice()->accessBitmap(false).isOpaque(); return canvas->getDevice()->accessBitmap(false).isOpaque();
} }

View File

@@ -116,9 +116,9 @@ void NinePatch_Draw(SkCanvas* canvas, const SkRect& bounds,
paint = &defaultPaint; paint = &defaultPaint;
} }
// if our canvas is GL, draw this as a mesh, which will be faster than // if our SkCanvas were back by GL we should enable this and draw this as
// in parts (which is faster for raster) // a mesh, which will be faster in most cases.
if (canvas && canvas->getViewport(NULL)) { if (false) {
SkNinePatch::DrawMesh(canvas, bounds, bitmap, SkNinePatch::DrawMesh(canvas, bounds, bitmap,
chunk.xDivs, chunk.numXDivs, chunk.xDivs, chunk.numXDivs,
chunk.yDivs, chunk.numYDivs, chunk.yDivs, chunk.numYDivs,

View File

@@ -2004,12 +2004,11 @@ void OpenGLRenderer::getAlphaAndMode(SkPaint* paint, int* alpha, SkXfermode::Mod
} }
SkXfermode::Mode OpenGLRenderer::getXfermode(SkXfermode* mode) { SkXfermode::Mode OpenGLRenderer::getXfermode(SkXfermode* mode) {
// In the future we should look at unifying the Porter-Duff modes and SkXfermode::Mode resultMode;
// SkXferModes so that we can use SkXfermode::IsMode(xfer, &mode). if (!SkXfermode::AsMode(mode, &resultMode)) {
if (mode == NULL) { resultMode = SkXfermode::kSrcOver_Mode;
return SkXfermode::kSrcOver_Mode;
} }
return mode->fMode; return resultMode;
} }
void OpenGLRenderer::setTextureWrapModes(Texture* texture, GLenum wrapS, GLenum wrapT) { void OpenGLRenderer::setTextureWrapModes(Texture* texture, GLenum wrapS, GLenum wrapT) {