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

Unified Diff: src/gpu/GrDrawContext.cpp

Issue 2271053004: Convert drawPaint to drawRRect in simple cases (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: fix another msvs warning Created 4 years, 4 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/GrClipStackClip.cpp ('k') | src/gpu/GrFixedClip.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrDrawContext.cpp
diff --git a/src/gpu/GrDrawContext.cpp b/src/gpu/GrDrawContext.cpp
index 5afb2eaec937d75dc49dee8379793f0f25cc700e..2bb9caa8b170d994862b5e0e51965fe9159023b2 100644
--- a/src/gpu/GrDrawContext.cpp
+++ b/src/gpu/GrDrawContext.cpp
@@ -251,6 +251,20 @@ void GrDrawContext::drawPaint(const GrClip& clip,
SkIntToScalar(fRenderTarget->height()));
SkTCopyOnFirstWrite<GrPaint> paint(origPaint);
+ SkRRect rrect;
+ bool aaRRect;
+ // Check if we can replace a clipRRect()/drawPaint() with a drawRRect(). We only do the
+ // transformation for non-rect rrects. Rects caused a performance regression on an Android
+ // test that needs investigation. We also skip cases where there are fragment processors
+ // because they may depend on having correct local coords and this path draws in device space
+ // without a local matrix.
+ if (!paint->numTotalFragmentProcessors() &&
+ clip.isRRect(r, &rrect, &aaRRect) && !rrect.isRect()) {
+ paint.writable()->setAntiAlias(aaRRect);
+ this->drawRRect(GrNoClip(), *paint, SkMatrix::I(), rrect, GrStyle::SimpleFill());
+ return;
+ }
+
// by definition this fills the entire clip, no need for AA
if (paint->isAntiAlias()) {
paint.writable()->setAntiAlias(false);
« no previous file with comments | « src/gpu/GrClipStackClip.cpp ('k') | src/gpu/GrFixedClip.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698