Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(263)

Unified Diff: src/gpu/GrDrawContext.cpp

Issue 1355353002: Create GrDraw and start fast pathing src over rects (Closed) Base URL: https://skia.googlesource.com/skia.git@strokerect2
Patch Set: tweaks Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrAtlasTextContext.cpp ('k') | src/gpu/GrDrawTarget.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrDrawContext.cpp
diff --git a/src/gpu/GrDrawContext.cpp b/src/gpu/GrDrawContext.cpp
index 1969bd03be29063f62139f16bb4e246aad63ba9e..db9d03b374ad2a30992c58cf485dd688da525b8b 100644
--- a/src/gpu/GrDrawContext.cpp
+++ b/src/gpu/GrDrawContext.cpp
@@ -21,6 +21,8 @@
#include "batches/GrDrawVerticesBatch.h"
#include "batches/GrRectBatchFactory.h"
+#include "draws/GrDraw.h"
+
#define ASSERT_OWNED_RESOURCE(R) SkASSERT(!(R) || (R)->getContext() == fContext)
#define RETURN_IF_ABANDONED if (!fDrawTarget) { return; }
#define RETURN_FALSE_IF_ABANDONED if (!fDrawTarget) { return false; }
@@ -279,7 +281,7 @@ void GrDrawContext::drawRect(GrRenderTarget* rt,
} else {
SkRect devBoundRect;
viewMatrix.mapRect(&devBoundRect, rect);
- batch.reset(GrRectBatchFactory::CreateAAFill(color, viewMatrix, rect, devBoundRect));
+ batch.reset(GrRectBatchFactory::CreateAAFill(color, viewMatrix, rect));
}
fDrawTarget->drawBatch(pipelineBuilder, batch);
return;
@@ -759,6 +761,17 @@ bool GrDrawContext::prepareToDraw(GrRenderTarget* rt) {
return true;
}
-void GrDrawContext::drawBatch(GrPipelineBuilder* pipelineBuilder, GrDrawBatch* batch) {
- fDrawTarget->drawBatch(*pipelineBuilder, batch);
+void GrDrawContext::drawBatch(const GrPipelineBuilder& pipelineBuilder, GrDrawBatch* batch) {
+ RETURN_IF_ABANDONED
+
+ AutoCheckFlush acf(fContext);
+ // The caller will assert it owns the rendertarget
+
+ fDrawTarget->drawBatch(pipelineBuilder, batch);
+}
+
+GrBatch* GrDrawContext::lastBatch() {
+ RETURN_NULL_IF_ABANDONED
+
+ return fDrawTarget->lastBatch();
}
« no previous file with comments | « src/gpu/GrAtlasTextContext.cpp ('k') | src/gpu/GrDrawTarget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698