aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu')
-rw-r--r--src/gpu/GrContext.cpp13
-rw-r--r--src/gpu/GrInOrderDrawBuffer.cpp10
-rw-r--r--src/gpu/GrInOrderDrawBuffer.h6
3 files changed, 8 insertions, 21 deletions
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index fe8f4fdedd..3cf596b8b2 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -1134,17 +1134,6 @@ void GrContext::flush(int flagsBitfield) {
if (kDiscard_FlushBit & flagsBitfield) {
fDrawBuffer->reset();
} else {
- this->flushDrawBuffer();
- }
- // TODO: Remove this flag
- if (kForceCurrentRenderTarget_FlushBit & flagsBitfield) {
- fGpu->drawState()->setRenderTarget(this->getRenderTarget());
- fGpu->forceRenderTargetFlush();
- }
-}
-
-void GrContext::flushDrawBuffer() {
- if (NULL != fDrawBuffer && !fDrawBuffer->isFlushing()) {
fDrawBuffer->flush();
}
}
@@ -1560,7 +1549,7 @@ GrDrawTarget* GrContext::prepareToDraw(const GrPaint* paint,
GrAssert(0 == fDrawState->numColorStages() && 0 == fDrawState->numCoverageStages());
if (kNo_BufferedDraw == buffered && kYes_BufferedDraw == fLastDrawWasBuffered) {
- this->flushDrawBuffer();
+ fDrawBuffer->flush();
fLastDrawWasBuffered = kNo_BufferedDraw;
}
ASSERT_OWNED_RESOURCE(fRenderTarget.get());
diff --git a/src/gpu/GrInOrderDrawBuffer.cpp b/src/gpu/GrInOrderDrawBuffer.cpp
index 18b70dc49c..dde66c5caf 100644
--- a/src/gpu/GrInOrderDrawBuffer.cpp
+++ b/src/gpu/GrInOrderDrawBuffer.cpp
@@ -445,15 +445,18 @@ void GrInOrderDrawBuffer::reset() {
fClipSet = true;
}
-bool GrInOrderDrawBuffer::flush() {
+void GrInOrderDrawBuffer::flush() {
+ if (fFlushing) {
+ return;
+ }
+
GrAssert(kReserved_GeometrySrcType != this->getGeomSrc().fVertexSrc);
GrAssert(kReserved_GeometrySrcType != this->getGeomSrc().fIndexSrc);
int numCmds = fCmds.count();
if (0 == numCmds) {
- return false;
+ return;
}
- GrAssert(!fFlushing);
GrAutoTRestore<bool> flushRestore(&fFlushing);
fFlushing = true;
@@ -533,7 +536,6 @@ bool GrInOrderDrawBuffer::flush() {
fDstGpu->setDrawState(prevDrawState);
prevDrawState->unref();
this->reset();
- return true;
}
bool GrInOrderDrawBuffer::onCopySurface(GrSurface* dst,
diff --git a/src/gpu/GrInOrderDrawBuffer.h b/src/gpu/GrInOrderDrawBuffer.h
index 6090235263..0871cc53f7 100644
--- a/src/gpu/GrInOrderDrawBuffer.h
+++ b/src/gpu/GrInOrderDrawBuffer.h
@@ -63,12 +63,8 @@ public:
* is destructive). This buffer must not have an active reserved vertex or index source. Any
* reserved geometry on the target will be finalized because it's geometry source will be pushed
* before flushing and popped afterwards.
- *
- * @return false if the playback trivially drew nothing because nothing was recorded.
*/
- bool flush();
-
- bool isFlushing() const { return fFlushing; }
+ void flush();
// overrides from GrDrawTarget
virtual bool geometryHints(int* vertexCount,