aboutsummaryrefslogtreecommitdiffhomepage
path: root/bench/CoverageBench.cpp
diff options
context:
space:
mode:
authorGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-11-04 20:57:36 +0000
committerGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-11-04 20:57:36 +0000
commit84e922bfb3e7a03f6e35beb2f1e4f2657e7cd3e9 (patch)
treee57c3c2c12fd8da316c8ee01f0eae00b346f6130 /bench/CoverageBench.cpp
parentd48c16b2ff83a78f71870ce86002a545a4513b3c (diff)
Revert "speed up A8 by creating a new entry-point in SkDraw that blits the path's coverage directly into an A8 target, regardless of the previous pixel values."
This reverts commit d615e839b71f75df895de6850b774a9e1c28ad2a. Revert "must initialize SkDraw.fClip" This reverts commit 108e46d29b5f57927fc8b8c403bb52019d8cb16d. BUG= Review URL: https://codereview.chromium.org/57883006 git-svn-id: http://skia.googlecode.com/svn/trunk@12122 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'bench/CoverageBench.cpp')
-rw-r--r--bench/CoverageBench.cpp71
1 files changed, 0 insertions, 71 deletions
diff --git a/bench/CoverageBench.cpp b/bench/CoverageBench.cpp
deleted file mode 100644
index de09733cf8..0000000000
--- a/bench/CoverageBench.cpp
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright 2013 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#include "SkBenchmark.h"
-#include "SkBitmap.h"
-#include "SkCanvas.h"
-#include "SkColorPriv.h"
-#include "SkDraw.h"
-#include "SkMatrix.h"
-#include "SkPath.h"
-#include "SkRasterClip.h"
-
-class DrawPathBench : public SkBenchmark {
- SkPaint fPaint;
- SkString fName;
- SkPath fPath;
- SkRasterClip fRC;
- SkBitmap fBitmap;
- SkMatrix fIdentity;
- SkDraw fDraw;
- bool fDrawCoverage;
-public:
- DrawPathBench(bool drawCoverage) : fDrawCoverage(drawCoverage) {
- fPaint.setAntiAlias(true);
- fName.printf("draw_coverage_%s", drawCoverage ? "true" : "false");
-
- fPath.moveTo(0, 0);
- fPath.quadTo(500, 0, 500, 500);
- fPath.quadTo(250, 0, 0, 500);
-
- fBitmap.setConfig(SkBitmap::kA8_Config, 500, 500);
- fBitmap.allocPixels();
-
- fIdentity.setIdentity();
- fRC.setRect(fPath.getBounds().round());
-
- fDraw.fBitmap = &fBitmap;
- fDraw.fMatrix = &fIdentity;
- fDraw.fClip = &fRC.bwRgn();
- fDraw.fRC = &fRC;
- }
-
-protected:
- virtual const char* onGetName() SK_OVERRIDE {
- return fName.c_str();
- }
-
- virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE {
- if (fDrawCoverage) {
- for (int i = 0; i < this->getLoops(); ++i) {
- fDraw.drawPathCoverage(fPath, fPaint);
- }
- } else {
- for (int i = 0; i < this->getLoops(); ++i) {
- fDraw.drawPath(fPath, fPaint);
- }
- }
- }
-
-private:
- typedef SkBenchmark INHERITED;
-};
-
-///////////////////////////////////////////////////////////////////////////////
-
-DEF_BENCH( return new DrawPathBench(false) )
-DEF_BENCH( return new DrawPathBench(true) )