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; }; diff --git a/gyp/bench.gyp b/gyp/bench.gyp index 8b4200a427..d404000fce 100644 --- a/gyp/bench.gyp +++ b/gyp/bench.gyp @@ -105,6 +105,9 @@ 'include_dirs' : [ '../src/gpu', ], + 'dependencies': [ + 'gputest.gyp:skgputest', + ], }, ], ],