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

Side by Side Diff: dm/DMSrcSink.cpp

Issue 1402863002: Implementation of SkBitmapRegionDecoder using SkAndroidCodec (Closed) Base URL: https://skia.googlesource.com/skia.git@split1
Patch Set: Add AndroidCodec strategy to benchmark 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 | « dm/DM.cpp ('k') | gyp/tools.gyp » ('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 "DMSrcSink.h" 8 #include "DMSrcSink.h"
9 #include "SamplePipeControllers.h" 9 #include "SamplePipeControllers.h"
10 #include "SkAndroidCodec.h" 10 #include "SkAndroidCodec.h"
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 return flags.type != SinkFlags::kRaster 81 return flags.type != SinkFlags::kRaster
82 || flags.approach != SinkFlags::kDirect; 82 || flags.approach != SinkFlags::kDirect;
83 } 83 }
84 84
85 static SkBitmapRegionDecoderInterface* create_brd(Path path, 85 static SkBitmapRegionDecoderInterface* create_brd(Path path,
86 SkBitmapRegionDecoderInterface::Strategy strategy) { 86 SkBitmapRegionDecoderInterface::Strategy strategy) {
87 SkAutoTUnref<SkData> encoded(SkData::NewFromFileName(path.c_str())); 87 SkAutoTUnref<SkData> encoded(SkData::NewFromFileName(path.c_str()));
88 if (!encoded) { 88 if (!encoded) {
89 return NULL; 89 return NULL;
90 } 90 }
91 return SkBitmapRegionDecoderInterface::CreateBitmapRegionDecoder(new SkMemor yStream(encoded), 91 return SkBitmapRegionDecoderInterface::CreateBitmapRegionDecoder(encoded, st rategy);
92 strategy);
93 } 92 }
94 93
95 Error BRDSrc::draw(SkCanvas* canvas) const { 94 Error BRDSrc::draw(SkCanvas* canvas) const {
96 SkColorType colorType = canvas->imageInfo().colorType(); 95 SkColorType colorType = canvas->imageInfo().colorType();
97 if (kRGB_565_SkColorType == colorType && 96 if (kRGB_565_SkColorType == colorType &&
98 CodecSrc::kGetFromCanvas_DstColorType != fDstColorType) { 97 CodecSrc::kGetFromCanvas_DstColorType != fDstColorType) {
99 return Error::Nonfatal("Testing non-565 to 565 is uninteresting."); 98 return Error::Nonfatal("Testing non-565 to 565 is uninteresting.");
100 } 99 }
101 switch (fDstColorType) { 100 switch (fDstColorType) {
102 case CodecSrc::kGetFromCanvas_DstColorType: 101 case CodecSrc::kGetFromCanvas_DstColorType:
(...skipping 1252 matching lines...) Expand 10 before | Expand all | Expand 10 after
1355 skr.visit<void>(i, drawsAsSingletonPictures); 1354 skr.visit<void>(i, drawsAsSingletonPictures);
1356 } 1355 }
1357 SkAutoTUnref<SkPicture> macroPic(macroRec.endRecordingAsPicture()); 1356 SkAutoTUnref<SkPicture> macroPic(macroRec.endRecordingAsPicture());
1358 1357
1359 canvas->drawPicture(macroPic); 1358 canvas->drawPicture(macroPic);
1360 return ""; 1359 return "";
1361 }); 1360 });
1362 } 1361 }
1363 1362
1364 } // namespace DM 1363 } // namespace DM
OLDNEW
« no previous file with comments | « dm/DM.cpp ('k') | gyp/tools.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698