aboutsummaryrefslogtreecommitdiffhomepage
path: root/bench/HairlinePathBench.cpp
diff options
context:
space:
mode:
authorGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-01-27 19:52:51 +0000
committerGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-01-27 19:52:51 +0000
commit78dd91d1afab51dd7cae870d4864410ced839b4b (patch)
tree7b9c13f29ad77df89a52cdbf17315548ae41a6eb /bench/HairlinePathBench.cpp
parentd15d469a6e80eec9f115294f65b1c62bf0c0b106 (diff)
Revert "Revert of Workaround for assertion in NVPR config in bench. (https://codereview.chromium.org/131503007/)"
add SK_SUPPORT_GPU check BUG=skia:2042 TBR=robertphillips@google.com Author: bsalomon@google.com Review URL: https://codereview.chromium.org/148173005 git-svn-id: http://skia.googlecode.com/svn/trunk@13203 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'bench/HairlinePathBench.cpp')
-rw-r--r--bench/HairlinePathBench.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/bench/HairlinePathBench.cpp b/bench/HairlinePathBench.cpp
index 87557e8467..16edcc7c17 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;
};