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

Unified Diff: bench/HairlinePathBench.cpp

Issue 148173005: Revert "Revert of Workaround for assertion in NVPR config in bench. (https://codereview.chromium.org (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: add SK_SUPPORT_GPU check around includes Created 6 years, 11 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 | « no previous file | gyp/bench.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/HairlinePathBench.cpp
diff --git a/bench/HairlinePathBench.cpp b/bench/HairlinePathBench.cpp
index 87557e84674845ca0e7d0abb822733bea0fdcef6..16edcc7c17acaaaaed4b7fa41f334e7f2eb54fd7 100644
--- a/bench/HairlinePathBench.cpp
+++ b/bench/HairlinePathBench.cpp
@@ -4,6 +4,11 @@
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
+
+#if SK_SUPPORT_GPU
+#include "GrTest.h"
+#include "GrDrawTargetCaps.h"
+#endif
#include "SkBenchmark.h"
#include "SkCanvas.h"
#include "SkPaint.h"
@@ -170,6 +175,22 @@ public:
weight);
}
}
+
+ virtual void onDraw(const int loops, SkCanvas* canvas) SK_OVERRIDE {
+#if SK_SUPPORT_GPU
+ GrContext* context = canvas->getGrContext();
+ // This is a workaround for skbug.com/2078. See also skbug.com/2033.
+ if (NULL != context) {
+ GrTestTarget tt;
+ context->getTestTarget(&tt);
+ if (tt.target()->caps()->pathRenderingSupport()) {
+ return;
+ }
+ }
+#endif
+ INHERITED::onDraw(loops, canvas);
+ }
+
private:
typedef HairlinePathBench INHERITED;
};
« no previous file with comments | « no previous file | gyp/bench.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698