From 52e935d04c59135739c3a68fb6e19d313dc6d5ad Mon Sep 17 00:00:00 2001 From: "brettw@google.com" Date: Fri, 12 Dec 2008 21:01:41 +0000 Subject: New drop of Skia. This is up to CL 121320. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6925 0039d316-1c4b-4281-b951-d872f2087c98 --- skia/gl/SkGLDevice.cpp | 29 ++++++++--------------------- 1 file changed, 8 insertions(+), 21 deletions(-) (limited to 'skia/gl/SkGLDevice.cpp') diff --git a/skia/gl/SkGLDevice.cpp b/skia/gl/SkGLDevice.cpp index 2271b05..70968e2 100644 --- a/skia/gl/SkGLDevice.cpp +++ b/skia/gl/SkGLDevice.cpp @@ -21,11 +21,8 @@ public: glTexCoordPointer(2, SK_TextGLType, 0, fTexs); glDisableClientState(GL_COLOR_ARRAY); glVertexPointer(2, SK_TextGLType, 0, fVerts); - - fCtx = SkGetGLContext(); } - void* ctx() const { return fCtx; } GLenum texture() const { return fCurrTexture; } void flush() { @@ -68,7 +65,6 @@ private: int fCurrQuad; int fViewportHeight; const SkRegion* fClip; - void* fCtx; }; /////////////////////////////////////////////////////////////////////////////// @@ -177,7 +173,7 @@ SkGLDevice::TexCache* SkGLDevice::setupGLPaintShader(const SkPaint& paint) { } bitmap.lockPixels(); - if (bitmap.getPixels() == NULL) { + if (!bitmap.readyToDraw()) { return NULL; } @@ -327,7 +323,7 @@ void SkGLDevice::drawBitmap(const SkDraw& draw, const SkBitmap& bitmap, TRACE_DRAW("coreDrawBitmap", this, draw); SkAutoLockPixels alp(bitmap); - if (bitmap.getPixels() == NULL) { + if (!bitmap.readyToDraw()) { return; } @@ -396,7 +392,7 @@ void SkGLDevice::drawSprite(const SkDraw& draw, const SkBitmap& bitmap, TRACE_DRAW("coreDrawSprite", this, draw); SkAutoLockPixels alp(bitmap); - if (bitmap.getPixels() == NULL) { + if (!bitmap.readyToDraw()) { return; } @@ -539,11 +535,8 @@ DONE: #include "SkGlyphCache.h" #include "SkGLTextCache.h" -static void SkGL_GlyphCacheAuxProc(void* data) { - SkGLTextCache* cache = (SkGLTextCache*)data; - - SkDebugf("-------------- delete text texture cache, ctx=%p\n", - cache->getCtx()); +void SkGLDevice::GlyphCacheAuxProc(void* data) { + SkDebugf("-------------- delete text texture cache\n"); SkDELETE((SkGLTextCache*)data); } @@ -576,19 +569,13 @@ static void SkGL_Draw1Glyph(const SkDraw1Glyph& state, const SkGlyph& glyph, void* auxData; SkGLTextCache* textCache = NULL; - if (gcache->getAuxProcData(SkGL_GlyphCacheAuxProc, &auxData)) { - textCache = (SkGLTextCache*)auxData; - if (textCache->getCtx() != procs->ctx()) { - SkDebugf("------- textcache: old ctx %p new ctx %p\n", - textCache->getCtx(), procs->ctx()); - SkDELETE(textCache); - textCache = NULL; - } + if (gcache->getAuxProcData(SkGLDevice::GlyphCacheAuxProc, &auxData)) { + textCache = (SkGLTextCache*)auxData; } if (NULL == textCache) { // need to create one textCache = SkNEW(SkGLTextCache); - gcache->setAuxProc(SkGL_GlyphCacheAuxProc, textCache); + gcache->setAuxProc(SkGLDevice::GlyphCacheAuxProc, textCache); } int offset; -- cgit v1.1