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

Side by Side Diff: bench/CodecBench.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/CodecBench.h ('k') | bench/ColorCubeBench.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 7
8 #include "CodecBench.h" 8 #include "CodecBench.h"
9 #include "CodecBenchPriv.h" 9 #include "CodecBenchPriv.h"
10 #include "SkBitmap.h" 10 #include "SkBitmap.h"
(...skipping 14 matching lines...) Expand all
25 } 25 }
26 26
27 const char* CodecBench::onGetName() { 27 const char* CodecBench::onGetName() {
28 return fName.c_str(); 28 return fName.c_str();
29 } 29 }
30 30
31 bool CodecBench::isSuitableFor(Backend backend) { 31 bool CodecBench::isSuitableFor(Backend backend) {
32 return kNonRendering_Backend == backend; 32 return kNonRendering_Backend == backend;
33 } 33 }
34 34
35 void CodecBench::onPreDraw() { 35 void CodecBench::onDelayedSetup() {
36 SkAutoTDelete<SkCodec> codec(SkCodec::NewFromData(fData)); 36 SkAutoTDelete<SkCodec> codec(SkCodec::NewFromData(fData));
37 37
38 fInfo = codec->getInfo().makeColorType(fColorType); 38 fInfo = codec->getInfo().makeColorType(fColorType);
39 SkAlphaType alphaType; 39 SkAlphaType alphaType;
40 // Caller should not have created this CodecBench if the alpha type was 40 // Caller should not have created this CodecBench if the alpha type was
41 // invalid. 41 // invalid.
42 SkAssertResult(SkColorTypeValidateAlphaType(fColorType, fInfo.alphaType(), 42 SkAssertResult(SkColorTypeValidateAlphaType(fColorType, fInfo.alphaType(),
43 &alphaType)); 43 &alphaType));
44 if (alphaType != fInfo.alphaType()) { 44 if (alphaType != fInfo.alphaType()) {
45 fInfo = fInfo.makeAlphaType(alphaType); 45 fInfo = fInfo.makeAlphaType(alphaType);
(...skipping 11 matching lines...) Expand all
57 codec.reset(SkCodec::NewFromData(fData)); 57 codec.reset(SkCodec::NewFromData(fData));
58 #ifdef SK_DEBUG 58 #ifdef SK_DEBUG
59 const SkCodec::Result result = 59 const SkCodec::Result result =
60 #endif 60 #endif
61 codec->getPixels(fInfo, fPixelStorage.get(), fInfo.minRowBytes(), 61 codec->getPixels(fInfo, fPixelStorage.get(), fInfo.minRowBytes(),
62 nullptr, colorTable, &colorCount); 62 nullptr, colorTable, &colorCount);
63 SkASSERT(result == SkCodec::kSuccess 63 SkASSERT(result == SkCodec::kSuccess
64 || result == SkCodec::kIncompleteInput); 64 || result == SkCodec::kIncompleteInput);
65 } 65 }
66 } 66 }
OLDNEW
« no previous file with comments | « bench/CodecBench.h ('k') | bench/ColorCubeBench.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698