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

Unified Diff: src/gpu/GrContext.cpp

Issue 23712005: Add bevel-stroke support in GrAARectRenderer (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: fix small bugs Created 7 years, 1 month 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/GrContext.cpp
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index 65d1fe9de64b4b1a51c94276e4c0a21ab15fd264..b0d34fd03933af6e531ca3b4ae78fbd723477cc7 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -795,7 +795,7 @@ static inline bool rect_contains_inclusive(const SkRect& rect, const SkPoint& po
void GrContext::drawRect(const GrPaint& paint,
const SkRect& rect,
- SkScalar width,
+ const SkStrokeRec* stroke,
const SkMatrix* matrix) {
SK_TRACE_EVENT0("GrContext::drawRect");
@@ -803,6 +803,7 @@ void GrContext::drawRect(const GrPaint& paint,
AutoCheckFlush acf(this);
GrDrawTarget* target = this->prepareToDraw(&paint, BUFFERED_DRAW, &are, &acf);
+ SkScalar width = stroke == NULL ? -1 : stroke->getWidth();
SkMatrix combinedMatrix = target->drawState()->getViewMatrix();
if (NULL != matrix) {
combinedMatrix.preConcat(*matrix);
@@ -855,9 +856,9 @@ void GrContext::drawRect(const GrPaint& paint,
return;
}
if (width >= 0) {
- fAARectRenderer->strokeAARect(this->getGpu(), target,
- rect, combinedMatrix, devBoundRect,
- width, useVertexCoverage);
+ fAARectRenderer->strokeAARect(this->getGpu(), target, rect,
+ combinedMatrix, devBoundRect,
+ stroke, useVertexCoverage);
} else {
// filled AA rect
fAARectRenderer->fillAARect(this->getGpu(), target,

Powered by Google App Engine
This is Rietveld 408576698