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

Unified Diff: src/gpu/GrOvalRenderer.cpp

Issue 14109033: Disable AA for ovals and roundrects if MSAA is enabled (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Fixes from comments Created 7 years, 8 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/GrContext.cpp ('k') | src/gpu/SkGpuDevice.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrOvalRenderer.cpp
===================================================================
--- src/gpu/GrOvalRenderer.cpp (revision 8926)
+++ src/gpu/GrOvalRenderer.cpp (working copy)
@@ -425,10 +425,10 @@
///////////////////////////////////////////////////////////////////////////////
-bool GrOvalRenderer::drawOval(GrDrawTarget* target, const GrContext* context, const GrPaint& paint,
- const GrRect& oval, const SkStrokeRec& stroke)
+bool GrOvalRenderer::drawOval(GrDrawTarget* target, const GrContext* context, bool useAA,
+ const GrRect& oval, const SkStrokeRec& stroke)
{
- if (!paint.isAntiAlias()) {
+ if (!useAA) {
return false;
}
@@ -437,11 +437,11 @@
// we can draw circles
if (SkScalarNearlyEqual(oval.width(), oval.height())
&& circle_stays_circle(vm)) {
- drawCircle(target, paint, oval, stroke);
+ this->drawCircle(target, useAA, oval, stroke);
// and axis-aligned ellipses only
} else if (vm.rectStaysRect()) {
- return drawEllipse(target, paint, oval, stroke);
+ return this->drawEllipse(target, useAA, oval, stroke);
} else {
return false;
@@ -463,7 +463,7 @@
};
void GrOvalRenderer::drawCircle(GrDrawTarget* target,
- const GrPaint& paint,
+ bool useAA,
const GrRect& circle,
const SkStrokeRec& stroke)
{
@@ -571,7 +571,7 @@
};
bool GrOvalRenderer::drawEllipse(GrDrawTarget* target,
- const GrPaint& paint,
+ bool useAA,
const GrRect& ellipse,
const SkStrokeRec& stroke)
{
@@ -580,7 +580,7 @@
{
// we should have checked for this previously
bool isAxisAlignedEllipse = drawState->getViewMatrix().rectStaysRect();
- SkASSERT(paint.isAntiAlias() && isAxisAlignedEllipse);
+ SkASSERT(useAA && isAxisAlignedEllipse);
}
#endif
@@ -742,15 +742,19 @@
return fRRectIndexBuffer;
}
-bool GrOvalRenderer::drawSimpleRRect(GrDrawTarget* target, GrContext* context,
- const GrPaint& paint, const SkRRect& rrect,
- const SkStrokeRec& stroke)
+bool GrOvalRenderer::drawSimpleRRect(GrDrawTarget* target, GrContext* context, bool useAA,
+ const SkRRect& rrect, const SkStrokeRec& stroke)
{
+ // only anti-aliased rrects for now
+ if (!useAA) {
+ return false;
+ }
+
const SkMatrix& vm = context->getMatrix();
#ifdef SK_DEBUG
{
// we should have checked for this previously
- SkASSERT(paint.isAntiAlias() && vm.rectStaysRect() && rrect.isSimple());
+ SkASSERT(useAA && vm.rectStaysRect() && rrect.isSimple());
}
#endif
« no previous file with comments | « src/gpu/GrContext.cpp ('k') | src/gpu/SkGpuDevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698