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

Unified Diff: src/gpu/SkGpuDevice.cpp

Issue 1750533003: Move drawDRRect back to GrDrawContext (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 10 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/GrDrawContext.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/SkGpuDevice.cpp
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index e97f275e7a362fac6be06797c420d23046a9dfa4..04bc14e5631fb3f3c2740ed4e991ec0eeb721d1f 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -44,7 +44,6 @@
#include "batches/GrRectBatchFactory.h"
#include "effects/GrBicubicEffect.h"
#include "effects/GrDashingEffect.h"
-#include "effects/GrRRectEffect.h"
#include "effects/GrSimpleTextureEffect.h"
#include "effects/GrTextureDomain.h"
#include "text/GrTextUtils.h"
@@ -561,65 +560,6 @@ void SkGpuDevice::drawRRect(const SkDraw& draw, const SkRRect& rect,
fDrawContext->drawRRect(fClip, grPaint, *draw.fMatrix, rect, strokeInfo);
}
-bool SkGpuDevice::drawFilledDRRect(const SkMatrix& viewMatrix, const SkRRect& origOuter,
- const SkRRect& origInner, const SkPaint& paint) {
- SkASSERT(!origInner.isEmpty());
- SkASSERT(!origOuter.isEmpty());
-
- bool applyAA = paint.isAntiAlias() && !fRenderTarget->isUnifiedMultisampled();
-
- GrPrimitiveEdgeType innerEdgeType = applyAA ? kInverseFillAA_GrProcessorEdgeType :
- kInverseFillBW_GrProcessorEdgeType;
- GrPrimitiveEdgeType outerEdgeType = applyAA ? kFillAA_GrProcessorEdgeType :
- kFillBW_GrProcessorEdgeType;
-
- SkTCopyOnFirstWrite<SkRRect> inner(origInner), outer(origOuter);
- SkMatrix inverseVM;
- if (!viewMatrix.isIdentity()) {
- if (!origInner.transform(viewMatrix, inner.writable())) {
- return false;
- }
- if (!origOuter.transform(viewMatrix, outer.writable())) {
- return false;
- }
- if (!viewMatrix.invert(&inverseVM)) {
- return false;
- }
- } else {
- inverseVM.reset();
- }
-
- GrPaint grPaint;
-
- if (!SkPaintToGrPaint(this->context(), paint, viewMatrix, &grPaint)) {
- return false;
- }
-
- grPaint.setAntiAlias(false);
-
- // TODO these need to be a geometry processors
- SkAutoTUnref<GrFragmentProcessor> innerEffect(GrRRectEffect::Create(innerEdgeType, *inner));
- if (!innerEffect) {
- return false;
- }
-
- SkAutoTUnref<GrFragmentProcessor> outerEffect(GrRRectEffect::Create(outerEdgeType, *outer));
- if (!outerEffect) {
- return false;
- }
-
- grPaint.addCoverageFragmentProcessor(innerEffect);
- grPaint.addCoverageFragmentProcessor(outerEffect);
-
- SkRect bounds = outer->getBounds();
- if (applyAA) {
- bounds.outset(SK_ScalarHalf, SK_ScalarHalf);
- }
-
- fDrawContext->fillRectWithLocalMatrix(fClip, grPaint, SkMatrix::I(), bounds, inverseVM);
- return true;
-}
-
void SkGpuDevice::drawDRRect(const SkDraw& draw, const SkRRect& outer,
const SkRRect& inner, const SkPaint& paint) {
@@ -639,9 +579,13 @@ void SkGpuDevice::drawDRRect(const SkDraw& draw, const SkRRect& outer,
SkStrokeRec stroke(paint);
if (stroke.isFillStyle() && !paint.getMaskFilter() && !paint.getPathEffect()) {
- if (this->drawFilledDRRect(*draw.fMatrix, outer, inner, paint)) {
+ GrPaint grPaint;
+ if (!SkPaintToGrPaint(this->context(), paint, *draw.fMatrix, &grPaint)) {
return;
}
+
+ fDrawContext->drawDRRect(fClip, grPaint, *draw.fMatrix, outer, inner);
+ return;
}
SkPath path;
« no previous file with comments | « src/gpu/GrDrawContext.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698