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

Unified Diff: src/gpu/GrDrawContext.cpp

Issue 2267273006: GPU implementation of drawRegion() (Closed) Base URL: https://skia.googlesource.com/skia.git@drawregion
Patch Set: Keep fixing stuff Created 4 years, 4 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
Index: src/gpu/GrDrawContext.cpp
diff --git a/src/gpu/GrDrawContext.cpp b/src/gpu/GrDrawContext.cpp
index 3b346b6efd302c68541db2a48701360f57aef9e0..dd5bf307293f3a0f32903dd4b99f265407af34d9 100644
--- a/src/gpu/GrDrawContext.cpp
+++ b/src/gpu/GrDrawContext.cpp
@@ -26,6 +26,7 @@
#include "batches/GrDrawVerticesBatch.h"
#include "batches/GrRectBatchFactory.h"
#include "batches/GrNinePatch.h" // TODO Factory
+#include "batches/GrRegionBatch.h"
#include "effects/GrRRectEffect.h"
@@ -944,6 +945,20 @@ void GrDrawContext::drawDRRect(const GrClip& clip,
///////////////////////////////////////////////////////////////////////////////
+void GrDrawContext::drawRegion(const GrClip& clip,
+ const GrPaint& paint,
+ const SkMatrix& viewMatrix,
+ const SkRegion& region) {
+ ASSERT_SINGLE_OWNER
+ RETURN_IF_ABANDONED
+ SkDEBUGCODE(this->validate();)
+ GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::drawRegion");
+
+ SkAutoTUnref<GrDrawBatch> batch(GrRegionBatch::Create(paint.getColor(), viewMatrix, region));
msarett 2016/08/25 16:36:17 Probably not ok to assume that we can always just
bsalomon 2016/08/25 17:49:02 It's ok.. if there is a shader or what not, that w
msarett 2016/08/25 20:51:41 Acknowledged.
+ GrPipelineBuilder pipelineBuilder(paint, false);
+ this->getDrawTarget()->drawBatch(pipelineBuilder, this, clip, batch);
+}
+
void GrDrawContext::drawOval(const GrClip& clip,
const GrPaint& paint,
const SkMatrix& viewMatrix,
« no previous file with comments | « include/gpu/GrDrawContext.h ('k') | src/gpu/SkGpuDevice.h » ('j') | src/gpu/SkGpuDevice.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698