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

Side by Side Diff: bench/BitmapRectBench.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/BitmapBench.cpp ('k') | bench/BitmapRegionDecoderBench.h » ('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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 60
61 protected: 61 protected:
62 const char* onGetName() override { 62 const char* onGetName() override {
63 fName.printf("bitmaprect_%02X_%sfilter_%s", 63 fName.printf("bitmaprect_%02X_%sfilter_%s",
64 fAlpha, 64 fAlpha,
65 kNone_SkFilterQuality == fFilterQuality ? "no" : "", 65 kNone_SkFilterQuality == fFilterQuality ? "no" : "",
66 fSlightMatrix ? "trans" : "identity"); 66 fSlightMatrix ? "trans" : "identity");
67 return fName.c_str(); 67 return fName.c_str();
68 } 68 }
69 69
70 void onPreDraw() override { 70 void onDelayedSetup() override {
71 fBitmap.allocPixels(); 71 fBitmap.allocPixels();
72 fBitmap.setAlphaType(kOpaque_SkAlphaType); 72 fBitmap.setAlphaType(kOpaque_SkAlphaType);
73 fBitmap.eraseColor(SK_ColorBLACK); 73 fBitmap.eraseColor(SK_ColorBLACK);
74 draw_into_bitmap(fBitmap); 74 draw_into_bitmap(fBitmap);
75 75
76 fSrcR.iset(0, 0, kWidth, kHeight); 76 fSrcR.iset(0, 0, kWidth, kHeight);
77 fDstR.iset(0, 0, kWidth, kHeight); 77 fDstR.iset(0, 0, kWidth, kHeight);
78 78
79 if (fSlightMatrix) { 79 if (fSlightMatrix) {
80 // want fractional translate 80 // want fractional translate
(...skipping 24 matching lines...) Expand all
105 typedef Benchmark INHERITED; 105 typedef Benchmark INHERITED;
106 }; 106 };
107 107
108 DEF_BENCH(return new BitmapRectBench(0xFF, kNone_SkFilterQuality, false)) 108 DEF_BENCH(return new BitmapRectBench(0xFF, kNone_SkFilterQuality, false))
109 DEF_BENCH(return new BitmapRectBench(0x80, kNone_SkFilterQuality, false)) 109 DEF_BENCH(return new BitmapRectBench(0x80, kNone_SkFilterQuality, false))
110 DEF_BENCH(return new BitmapRectBench(0xFF, kLow_SkFilterQuality, false)) 110 DEF_BENCH(return new BitmapRectBench(0xFF, kLow_SkFilterQuality, false))
111 DEF_BENCH(return new BitmapRectBench(0x80, kLow_SkFilterQuality, false)) 111 DEF_BENCH(return new BitmapRectBench(0x80, kLow_SkFilterQuality, false))
112 112
113 DEF_BENCH(return new BitmapRectBench(0xFF, kNone_SkFilterQuality, true)) 113 DEF_BENCH(return new BitmapRectBench(0xFF, kNone_SkFilterQuality, true))
114 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 | « bench/BitmapBench.cpp ('k') | bench/BitmapRegionDecoderBench.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698