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

Side by Side Diff: bench/ColorCodecBench.cpp

Issue 2170793004: Remove unnecessary getColorSpace() API from SkCodec (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Pass refs more efficiently Created 4 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 | dm/DMSrcSink.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 2016 Google Inc. 2 * Copyright 2016 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 "ColorCodecBench.h" 8 #include "ColorCodecBench.h"
9 #include "Resources.h" 9 #include "Resources.h"
10 #include "SkCodec.h" 10 #include "SkCodec.h"
(...skipping 29 matching lines...) Expand all
40 } 40 }
41 41
42 void ColorCodecBench::decodeAndXform() { 42 void ColorCodecBench::decodeAndXform() {
43 SkAutoTDelete<SkCodec> codec(SkCodec::NewFromData(fEncoded.get())); 43 SkAutoTDelete<SkCodec> codec(SkCodec::NewFromData(fEncoded.get()));
44 #ifdef SK_DEBUG 44 #ifdef SK_DEBUG
45 const SkCodec::Result result = 45 const SkCodec::Result result =
46 #endif 46 #endif
47 codec->startScanlineDecode(fSrcInfo); 47 codec->startScanlineDecode(fSrcInfo);
48 SkASSERT(SkCodec::kSuccess == result); 48 SkASSERT(SkCodec::kSuccess == result);
49 49
50 sk_sp<SkColorSpace> srcSpace = sk_ref_sp(codec->getColorSpace()); 50 sk_sp<SkColorSpace> srcSpace = sk_ref_sp(codec->getInfo().colorSpace());
51 if (!srcSpace) { 51 if (!srcSpace) {
52 srcSpace = SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named); 52 srcSpace = SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named);
53 } 53 }
54 std::unique_ptr<SkColorSpaceXform> xform = SkColorSpaceXform::New(srcSpace, fDstSpace); 54 std::unique_ptr<SkColorSpaceXform> xform = SkColorSpaceXform::New(srcSpace, fDstSpace);
55 SkASSERT(xform); 55 SkASSERT(xform);
56 56
57 void* dst = fDst.get(); 57 void* dst = fDst.get();
58 for (int y = 0; y < fSrcInfo.height(); y++) { 58 for (int y = 0; y < fSrcInfo.height(); y++) {
59 #ifdef SK_DEBUG 59 #ifdef SK_DEBUG
60 const int rows = 60 const int rows =
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 #endif 221 #endif
222 { 222 {
223 if (FLAGS_xform_only) { 223 if (FLAGS_xform_only) {
224 this->xformOnly(); 224 this->xformOnly();
225 } else { 225 } else {
226 this->decodeAndXform(); 226 this->decodeAndXform();
227 } 227 }
228 } 228 }
229 } 229 }
230 } 230 }
OLDNEW
« no previous file with comments | « no previous file | dm/DMSrcSink.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698