summaryrefslogtreecommitdiffstats
path: root/WebCore/platform/graphics/android/BaseTile.cpp
diff options
context:
space:
mode:
authorDerek Sollenberger <djsollen@google.com>2011-02-22 14:00:57 -0500
committerDerek Sollenberger <djsollen@google.com>2011-02-22 14:36:48 -0500
commitb33016812afef21c69df5ab3d5b85eab5fef7c5c (patch)
tree0f08eed2e423d84b8e8582e3e44ff759cd493a6e /WebCore/platform/graphics/android/BaseTile.cpp
parente248a68aa5529c1e5faba09893cf079b0657d898 (diff)
downloadexternal_webkit-b33016812afef21c69df5ab3d5b85eab5fef7c5c.zip
external_webkit-b33016812afef21c69df5ab3d5b85eab5fef7c5c.tar.gz
external_webkit-b33016812afef21c69df5ab3d5b85eab5fef7c5c.tar.bz2
Skia Merge (revision 808)
This is a companion CL to the one found in /external/skia Change-Id: I469b8845a88f24d972fd57ee5c9cab505a5b83aa
Diffstat (limited to 'WebCore/platform/graphics/android/BaseTile.cpp')
-rw-r--r--WebCore/platform/graphics/android/BaseTile.cpp33
1 files changed, 32 insertions, 1 deletions
diff --git a/WebCore/platform/graphics/android/BaseTile.cpp b/WebCore/platform/graphics/android/BaseTile.cpp
index bfd5118..9499870 100644
--- a/WebCore/platform/graphics/android/BaseTile.cpp
+++ b/WebCore/platform/graphics/android/BaseTile.cpp
@@ -254,7 +254,27 @@ void BaseTile::paintBitmap()
float w = tileWidth * invScale;
float h = tileHeight * invScale;
- SkCanvas* canvas = texture->canvas();
+ SkCanvas* canvas;
+
+#ifdef USE_SKIA_GPU
+ GLuint fboId;
+ glGenFramebuffersEXT(1, &fboId);
+ glBindFramebuffer(GL_FRAMEBUFFER, fboId);
+ glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, textureInfo->m_textureId, 0);
+ glCheckFramebufferStatus(GL_FRAMEBUFFER)); // should return GL_FRAMEBUFFER_COMPLETE
+
+ //Do I need to assign a width/height/format?
+
+ GrContext* context = gr_get_global_ctx();
+ context->resetContext();
+ GrRenderTarget* target = context->createPlatformRenderTarget(fboId, tileWidth, tileHeight);
+ SkCanvas tmpCanvas;
+ SkDevice* device = new SkGpuDevice(context, bm, target);
+ tmpCanvas.setDevice(device)->unref();
+ canvas = &tmpCanvas;
+#else
+ canvas = texture->canvas();
+#endif
canvas->save();
canvas->drawColor(tiledPage->glWebViewState()->getBackgroundColor());
@@ -279,7 +299,18 @@ void BaseTile::paintBitmap()
}
texture->setTile(x, y);
+
+#ifdef USE_SKIA_GPU
+ // set the texture info w/h/format
+ textureInfo->m_width = tileWidth;
+ textureInfo->m_height = tileHeight;
+ texture->producerReleaseAndSwap();
+
+ glBindFramebuffer(GL_FRAMEBUFFER, 0); // rebind the standard FBO
+ glDeleteFramebuffers(1, &fboId);
+#else
texture->producerUpdate(textureInfo);
+#endif
m_atomicSync.lock();
m_lastPaintedPicture = pictureCount;