summaryrefslogtreecommitdiffstats
path: root/skia/gl/SkGLDevice.cpp
diff options
context:
space:
mode:
authorbrettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-12 21:01:41 +0000
committerbrettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-12 21:01:41 +0000
commit52e935d04c59135739c3a68fb6e19d313dc6d5ad (patch)
tree95f7ab178b045bef4456cbf92c6aa7e476becd99 /skia/gl/SkGLDevice.cpp
parent30fab79877b4bb067944b74d98346ac9bb6bfc7e (diff)
downloadchromium_src-52e935d04c59135739c3a68fb6e19d313dc6d5ad.zip
chromium_src-52e935d04c59135739c3a68fb6e19d313dc6d5ad.tar.gz
chromium_src-52e935d04c59135739c3a68fb6e19d313dc6d5ad.tar.bz2
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
Diffstat (limited to 'skia/gl/SkGLDevice.cpp')
-rw-r--r--skia/gl/SkGLDevice.cpp29
1 files changed, 8 insertions, 21 deletions
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;