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

Unified Diff: src/gpu/GrSWMaskHelper.cpp

Issue 1967513002: Revert of Replace GrStrokeInfo with GrStyle. (Closed) Base URL: https://chromium.googlesource.com/skia.git@resscale
Patch Set: Created 4 years, 7 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.h ('k') | src/gpu/GrSoftwarePathRenderer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrSWMaskHelper.cpp
diff --git a/src/gpu/GrSWMaskHelper.cpp b/src/gpu/GrSWMaskHelper.cpp
index 937b34380ba464951ff9e59870c145326be033b9..b69edab82cab030c7c541d86a9df1a7e3e44439e 100644
--- a/src/gpu/GrSWMaskHelper.cpp
+++ b/src/gpu/GrSWMaskHelper.cpp
@@ -11,7 +11,6 @@
#include "GrDrawTarget.h"
#include "GrGpu.h"
#include "GrPipelineBuilder.h"
-#include "GrStyle.h"
#include "SkData.h"
#include "SkDistanceFieldGen.h"
@@ -118,11 +117,22 @@
/**
* Draw a single path element of the clip stack into the accumulation bitmap
*/
-void GrSWMaskHelper::draw(const SkPath& path, const GrStyle& style, SkRegion::Op op,
+void GrSWMaskHelper::draw(const SkPath& path, const SkStrokeRec& stroke, SkRegion::Op op,
bool antiAlias, uint8_t alpha) {
+
SkPaint paint;
- paint.setPathEffect(sk_ref_sp(style.pathEffect()));
- style.strokeRec().applyToPaint(&paint);
+ if (stroke.isHairlineStyle()) {
+ paint.setStyle(SkPaint::kStroke_Style);
+ } else {
+ if (stroke.isFillStyle()) {
+ paint.setStyle(SkPaint::kFill_Style);
+ } else {
+ paint.setStyle(SkPaint::kStroke_Style);
+ paint.setStrokeJoin(stroke.getJoin());
+ paint.setStrokeCap(stroke.getCap());
+ paint.setStrokeWidth(stroke.getWidth());
+ }
+ }
paint.setAntiAlias(antiAlias);
SkTBlitterAllocator allocator;
@@ -297,7 +307,7 @@
*/
GrTexture* GrSWMaskHelper::DrawPathMaskToTexture(GrContext* context,
const SkPath& path,
- const GrStyle& style,
+ const SkStrokeRec& stroke,
const SkIRect& resultBounds,
bool antiAlias,
const SkMatrix* matrix) {
@@ -307,7 +317,7 @@
return nullptr;
}
- helper.draw(path, style, SkRegion::kReplace_Op, antiAlias, 0xFF);
+ helper.draw(path, stroke, SkRegion::kReplace_Op, antiAlias, 0xFF);
GrTexture* texture(helper.createTexture());
if (!texture) {
« no previous file with comments | « src/gpu/GrSWMaskHelper.h ('k') | src/gpu/GrSoftwarePathRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698