| OLD | NEW |
| 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 "DMSrcSink.h" | 8 #include "DMSrcSink.h" |
| 9 #include "SamplePipeControllers.h" | 9 #include "SamplePipeControllers.h" |
| 10 #include "SkCodec.h" | 10 #include "SkCodec.h" |
| 11 #include "SkCodecTools.h" |
| 11 #include "SkCommonFlags.h" | 12 #include "SkCommonFlags.h" |
| 12 #include "SkData.h" | 13 #include "SkData.h" |
| 13 #include "SkDocument.h" | 14 #include "SkDocument.h" |
| 14 #include "SkError.h" | 15 #include "SkError.h" |
| 15 #include "SkFunction.h" | 16 #include "SkFunction.h" |
| 16 #include "SkImageGenerator.h" | 17 #include "SkImageGenerator.h" |
| 17 #include "SkMultiPictureDraw.h" | 18 #include "SkMultiPictureDraw.h" |
| 18 #include "SkNullCanvas.h" | 19 #include "SkNullCanvas.h" |
| 19 #include "SkOSFile.h" | 20 #include "SkOSFile.h" |
| 20 #include "SkPictureData.h" | 21 #include "SkPictureData.h" |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 static SkString get_scaled_name(const Path& path, float scale) { | 210 static SkString get_scaled_name(const Path& path, float scale) { |
| 210 return SkStringPrintf("%s_%.3f", SkOSPath::Basename(path.c_str()).c_str(), s
cale); | 211 return SkStringPrintf("%s_%.3f", SkOSPath::Basename(path.c_str()).c_str(), s
cale); |
| 211 } | 212 } |
| 212 | 213 |
| 213 Name BRDSrc::name() const { | 214 Name BRDSrc::name() const { |
| 214 // We will replicate the names used by CodecSrc so that images can | 215 // We will replicate the names used by CodecSrc so that images can |
| 215 // be compared in Gold. | 216 // be compared in Gold. |
| 216 if (1 == fSampleSize) { | 217 if (1 == fSampleSize) { |
| 217 return SkOSPath::Basename(fPath.c_str()); | 218 return SkOSPath::Basename(fPath.c_str()); |
| 218 } | 219 } |
| 219 return get_scaled_name(fPath, BRDSrc::GetScale(fSampleSize)); | 220 return get_scaled_name(fPath, get_scale_from_sample_size(fSampleSize)); |
| 220 } | 221 } |
| 221 | 222 |
| 222 /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~*/ | 223 /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~*/ |
| 223 | 224 |
| 224 CodecSrc::CodecSrc(Path path, Mode mode, DstColorType dstColorType, float scale) | 225 CodecSrc::CodecSrc(Path path, Mode mode, DstColorType dstColorType, float scale) |
| 225 : fPath(path) | 226 : fPath(path) |
| 226 , fMode(mode) | 227 , fMode(mode) |
| 227 , fDstColorType(dstColorType) | 228 , fDstColorType(dstColorType) |
| 228 , fScale(scale) | 229 , fScale(scale) |
| 229 {} | 230 {} |
| (...skipping 1032 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1262 skr.visit<void>(i, drawsAsSingletonPictures); | 1263 skr.visit<void>(i, drawsAsSingletonPictures); |
| 1263 } | 1264 } |
| 1264 SkAutoTUnref<SkPicture> macroPic(macroRec.endRecordingAsPicture()); | 1265 SkAutoTUnref<SkPicture> macroPic(macroRec.endRecordingAsPicture()); |
| 1265 | 1266 |
| 1266 canvas->drawPicture(macroPic); | 1267 canvas->drawPicture(macroPic); |
| 1267 return ""; | 1268 return ""; |
| 1268 }); | 1269 }); |
| 1269 } | 1270 } |
| 1270 | 1271 |
| 1271 } // namespace DM | 1272 } // namespace DM |
| OLD | NEW |