| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |