diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/gpu/GrBatchedTextContext.cpp | 2 | ||||
-rw-r--r-- | src/gpu/GrContext.cpp | 35 | ||||
-rw-r--r-- | src/gpu/GrDefaultTextContext.cpp | 2 |
3 files changed, 13 insertions, 26 deletions
diff --git a/src/gpu/GrBatchedTextContext.cpp b/src/gpu/GrBatchedTextContext.cpp index 3b3a4ba0b9..9de2badb17 100644 --- a/src/gpu/GrBatchedTextContext.cpp +++ b/src/gpu/GrBatchedTextContext.cpp @@ -70,7 +70,7 @@ void GrBatchedTextContext::setupVertexBuff(void** vertexBuff, NULL); if (flush) { this->flush(); - fContext->flushText(); + fContext->flush(); fDrawTarget = fContext->getTextTarget(fGrPaint); fMaxVertices = kDefaultRequestedVerts; // ignore return, no point in flushing again. diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp index 4ef0f5badf..4b3d942d61 100644 --- a/src/gpu/GrContext.cpp +++ b/src/gpu/GrContext.cpp @@ -1539,18 +1539,10 @@ void GrContext::flush(int flagsBitfield) { } } -void GrContext::flushText() { - if (kText_DrawCategory == fLastDrawCategory) { - flushDrawBuffer(); - } -} - void GrContext::flushDrawBuffer() { -#if BATCH_RECT_TO_RECT || DEFER_TEXT_RENDERING if (fDrawBuffer) { fDrawBuffer->flushTo(fGpu); } -#endif } void GrContext::internalWriteTexturePixels(GrTexture* texture, @@ -1955,21 +1947,16 @@ GrDrawTarget* GrContext::prepareToDraw(const GrPaint& paint, this->setPaint(paint); GrDrawTarget* target = fGpu; switch (category) { - case kText_DrawCategory: -#if DEFER_TEXT_RENDERING - target = fDrawBuffer; - fDrawBuffer->setClip(fGpu->getClip()); -#else - target = fGpu; -#endif - break; - case kUnbuffered_DrawCategory: - target = fGpu; - break; - case kBuffered_DrawCategory: - target = fDrawBuffer; - fDrawBuffer->setClip(fGpu->getClip()); - break; + case kUnbuffered_DrawCategory: + target = fGpu; + break; + case kBuffered_DrawCategory: + target = fDrawBuffer; + fDrawBuffer->setClip(fGpu->getClip()); + break; + default: + GrCrash("Unexpected DrawCategory."); + break; } return target; } @@ -2093,7 +2080,7 @@ void GrContext::setupDrawBuffer() { GrDrawTarget* GrContext::getTextTarget(const GrPaint& paint) { #if DEFER_TEXT_RENDERING - return prepareToDraw(paint, kText_DrawCategory); + return prepareToDraw(paint, kBuffered_DrawCategory); #else return prepareToDraw(paint, kUnbuffered_DrawCategory); #endif diff --git a/src/gpu/GrDefaultTextContext.cpp b/src/gpu/GrDefaultTextContext.cpp index d2c5d924a3..a606dd5c64 100644 --- a/src/gpu/GrDefaultTextContext.cpp +++ b/src/gpu/GrDefaultTextContext.cpp @@ -211,7 +211,7 @@ void GrDefaultTextContext::drawPackedGlyph(GrGlyph::PackedID packed, // before we purge the cache, we must flush any accumulated draws this->flushGlyphs(); - fContext->flushText(); + fContext->flush(); // try to purge fContext->getFontCache()->purgeExceptFor(fStrike); |