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

Unified Diff: src/gpu/GrSoftwarePathRenderer.cpp

Issue 1584703003: Remove two varieties of drawNonAARect from GrDrawTarget (Closed) Base URL: https://skia.googlesource.com/skia.git@hidedrawtargetabit
Patch Set: deprecation message on GrTest Created 4 years, 11 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/GrSWMaskHelper.cpp ('k') | src/gpu/GrTest.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrSoftwarePathRenderer.cpp
diff --git a/src/gpu/GrSoftwarePathRenderer.cpp b/src/gpu/GrSoftwarePathRenderer.cpp
index a136886a6400f59b0fade456c9f4ac765dc70b78..28a4b9ccfe068b463c1fd5bd4c920ad71eca0cef 100644
--- a/src/gpu/GrSoftwarePathRenderer.cpp
+++ b/src/gpu/GrSoftwarePathRenderer.cpp
@@ -10,6 +10,7 @@
#include "GrContext.h"
#include "GrSWMaskHelper.h"
#include "GrVertexBuffer.h"
+#include "batches/GrRectBatchFactory.h"
////////////////////////////////////////////////////////////////////////////////
bool GrSoftwarePathRenderer::onCanDrawPath(const CanDrawPathArgs& args) const {
@@ -65,6 +66,17 @@ bool get_path_and_clip_bounds(const GrPipelineBuilder* pipelineBuilder,
}
////////////////////////////////////////////////////////////////////////////////
+static void draw_non_aa_rect(GrDrawTarget* drawTarget,
+ const GrPipelineBuilder& pipelineBuilder,
+ GrColor color,
+ const SkMatrix& viewMatrix,
+ const SkRect& rect,
+ const SkMatrix& localMatrix) {
+ SkAutoTUnref<GrDrawBatch> batch(GrRectBatchFactory::CreateNonAAFill(color, viewMatrix, rect,
+ nullptr, &localMatrix));
+ drawTarget->drawBatch(pipelineBuilder, batch);
+}
+
void draw_around_inv_path(GrDrawTarget* target,
GrPipelineBuilder* pipelineBuilder,
GrColor color,
@@ -80,22 +92,22 @@ void draw_around_inv_path(GrDrawTarget* target,
if (devClipBounds.fTop < devPathBounds.fTop) {
rect.iset(devClipBounds.fLeft, devClipBounds.fTop,
devClipBounds.fRight, devPathBounds.fTop);
- target->drawNonAARect(*pipelineBuilder, color, SkMatrix::I(), rect, invert);
+ draw_non_aa_rect(target, *pipelineBuilder, color, SkMatrix::I(), rect, invert);
}
if (devClipBounds.fLeft < devPathBounds.fLeft) {
rect.iset(devClipBounds.fLeft, devPathBounds.fTop,
devPathBounds.fLeft, devPathBounds.fBottom);
- target->drawNonAARect(*pipelineBuilder, color, SkMatrix::I(), rect, invert);
+ draw_non_aa_rect(target, *pipelineBuilder, color, SkMatrix::I(), rect, invert);
}
if (devClipBounds.fRight > devPathBounds.fRight) {
rect.iset(devPathBounds.fRight, devPathBounds.fTop,
devClipBounds.fRight, devPathBounds.fBottom);
- target->drawNonAARect(*pipelineBuilder, color, SkMatrix::I(), rect, invert);
+ draw_non_aa_rect(target, *pipelineBuilder, color, SkMatrix::I(), rect, invert);
}
if (devClipBounds.fBottom > devPathBounds.fBottom) {
rect.iset(devClipBounds.fLeft, devPathBounds.fBottom,
devClipBounds.fRight, devClipBounds.fBottom);
- target->drawNonAARect(*pipelineBuilder, color, SkMatrix::I(), rect, invert);
+ draw_non_aa_rect(target, *pipelineBuilder, color, SkMatrix::I(), rect, invert);
}
}
« no previous file with comments | « src/gpu/GrSWMaskHelper.cpp ('k') | src/gpu/GrTest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698