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

Side by Side Diff: bench/BitmapRectBench.cpp

Issue 1240753003: Revert[2] of guard to remove DrawBitmapRectFlags (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | bench/GameBench.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 #include "Benchmark.h" 8 #include "Benchmark.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 89
90 void onDraw(const int loops, SkCanvas* canvas) override { 90 void onDraw(const int loops, SkCanvas* canvas) override {
91 SkRandom rand; 91 SkRandom rand;
92 92
93 SkPaint paint; 93 SkPaint paint;
94 this->setupPaint(&paint); 94 this->setupPaint(&paint);
95 paint.setFilterQuality(fFilterQuality); 95 paint.setFilterQuality(fFilterQuality);
96 paint.setAlpha(fAlpha); 96 paint.setAlpha(fAlpha);
97 97
98 for (int i = 0; i < loops; i++) { 98 for (int i = 0; i < loops; i++) {
99 canvas->drawBitmapRectToRect(fBitmap, &fSrcR, fDstR, &paint); 99 canvas->drawBitmapRect(fBitmap, &fSrcR, fDstR, &paint,
100 SkCanvas::kStrict_SrcRectConstraint);
100 } 101 }
101 } 102 }
102 103
103 private: 104 private:
104 typedef Benchmark INHERITED; 105 typedef Benchmark INHERITED;
105 }; 106 };
106 107
107 DEF_BENCH(return new BitmapRectBench(0xFF, kNone_SkFilterQuality, false)) 108 DEF_BENCH(return new BitmapRectBench(0xFF, kNone_SkFilterQuality, false))
108 DEF_BENCH(return new BitmapRectBench(0x80, kNone_SkFilterQuality, false)) 109 DEF_BENCH(return new BitmapRectBench(0x80, kNone_SkFilterQuality, false))
109 DEF_BENCH(return new BitmapRectBench(0xFF, kLow_SkFilterQuality, false)) 110 DEF_BENCH(return new BitmapRectBench(0xFF, kLow_SkFilterQuality, false))
110 DEF_BENCH(return new BitmapRectBench(0x80, kLow_SkFilterQuality, false)) 111 DEF_BENCH(return new BitmapRectBench(0x80, kLow_SkFilterQuality, false))
111 112
112 DEF_BENCH(return new BitmapRectBench(0xFF, kNone_SkFilterQuality, true)) 113 DEF_BENCH(return new BitmapRectBench(0xFF, kNone_SkFilterQuality, true))
113 DEF_BENCH(return new BitmapRectBench(0xFF, kLow_SkFilterQuality, true)) 114 DEF_BENCH(return new BitmapRectBench(0xFF, kLow_SkFilterQuality, true))
OLDNEW
« no previous file with comments | « no previous file | bench/GameBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698