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

Side by Side Diff: bench/DrawBitmapAABench.cpp

Issue 1379853003: Fix for nexus 5 crashing in GL benches (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: tweaks Created 5 years, 2 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 | « bench/DisplacementBench.cpp ('k') | bench/ETCBitmapBench.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 * Copyright 2015 Google Inc. 2 * Copyright 2015 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 #include "Benchmark.h" 7 #include "Benchmark.h"
8 #include "SkCanvas.h" 8 #include "SkCanvas.h"
9 #include "SkMatrix.h" 9 #include "SkMatrix.h"
10 #include "SkPaint.h" 10 #include "SkPaint.h"
(...skipping 14 matching lines...) Expand all
25 // Most clients use filtering, so let's focus on this for now. 25 // Most clients use filtering, so let's focus on this for now.
26 fPaint.setFilterQuality(kLow_SkFilterQuality); 26 fPaint.setFilterQuality(kLow_SkFilterQuality);
27 fName.appendf("%s_%s", doAA ? "aa" : "noaa", name); 27 fName.appendf("%s_%s", doAA ? "aa" : "noaa", name);
28 } 28 }
29 29
30 protected: 30 protected:
31 const char* onGetName() override { 31 const char* onGetName() override {
32 return fName.c_str(); 32 return fName.c_str();
33 } 33 }
34 34
35 void onPreDraw() override { 35 void onDelayedSetup() override {
36 fBitmap.allocN32Pixels(200, 200); 36 fBitmap.allocN32Pixels(200, 200);
37 fBitmap.eraseARGB(255, 0, 255, 0); 37 fBitmap.eraseARGB(255, 0, 255, 0);
38 } 38 }
39 39
40 void onDraw(const int loops, SkCanvas* canvas) override { 40 void onDraw(const int loops, SkCanvas* canvas) override {
41 canvas->concat(fMatrix); 41 canvas->concat(fMatrix);
42 for (int i = 0; i < loops; i++) { 42 for (int i = 0; i < loops; i++) {
43 canvas->drawBitmap(fBitmap, 0, 0, &fPaint); 43 canvas->drawBitmap(fBitmap, 0, 0, &fPaint);
44 } 44 }
45 } 45 }
(...skipping 25 matching lines...) Expand all
71 DEF_BENCH( return new DrawBitmapAABench(true, SkMatrix::MakeScale(1.17f), "scale "); ) 71 DEF_BENCH( return new DrawBitmapAABench(true, SkMatrix::MakeScale(1.17f), "scale "); )
72 72
73 DEF_BENCH( return new DrawBitmapAABench(true, SkMatrix::MakeTrans(17.5f, 17.5f), "translate"); ) 73 DEF_BENCH( return new DrawBitmapAABench(true, SkMatrix::MakeTrans(17.5f, 17.5f), "translate"); )
74 74
75 DEF_BENCH( 75 DEF_BENCH(
76 SkMatrix m; 76 SkMatrix m;
77 m.reset(); 77 m.reset();
78 m.preRotate(15); 78 m.preRotate(15);
79 return new DrawBitmapAABench(true, m, "rotate"); 79 return new DrawBitmapAABench(true, m, "rotate");
80 ) 80 )
OLDNEW
« no previous file with comments | « bench/DisplacementBench.cpp ('k') | bench/ETCBitmapBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698