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

Side by Side Diff: src/images/SkImageDecoder_libbmp.cpp

Issue 24269006: Add an option on SkImageDecoder to skip writing 0s. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Rebase, plus update the benchmark Created 7 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 | Annotate | Revision Log
« no previous file with comments | « src/images/SkImageDecoder.cpp ('k') | src/images/SkImageDecoder_libjpeg.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 /* 2 /*
3 * Copyright 2007 The Android Open Source Project 3 * Copyright 2007 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #include "bmpdecoderhelper.h" 10 #include "bmpdecoderhelper.h"
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 if (justBounds) { 139 if (justBounds) {
140 return true; 140 return true;
141 } 141 }
142 142
143 if (!this->allocPixelRef(bm, NULL)) { 143 if (!this->allocPixelRef(bm, NULL)) {
144 return false; 144 return false;
145 } 145 }
146 146
147 SkAutoLockPixels alp(*bm); 147 SkAutoLockPixels alp(*bm);
148 148
149 if (!sampler.begin(bm, SkScaledBitmapSampler::kRGB, getDitherImage())) { 149 if (!sampler.begin(bm, SkScaledBitmapSampler::kRGB, *this)) {
150 return false; 150 return false;
151 } 151 }
152 152
153 const int srcRowBytes = width * 3; 153 const int srcRowBytes = width * 3;
154 const int dstHeight = sampler.scaledHeight(); 154 const int dstHeight = sampler.scaledHeight();
155 const uint8_t* srcRow = callback.rgb(); 155 const uint8_t* srcRow = callback.rgb();
156 156
157 srcRow += sampler.srcY0() * srcRowBytes; 157 srcRow += sampler.srcY0() * srcRowBytes;
158 for (int y = 0; y < dstHeight; y++) { 158 for (int y = 0; y < dstHeight; y++) {
159 sampler.next(srcRow); 159 sampler.next(srcRow);
160 srcRow += sampler.srcDY() * srcRowBytes; 160 srcRow += sampler.srcDY() * srcRowBytes;
161 } 161 }
162 return true; 162 return true;
163 } 163 }
OLDNEW
« no previous file with comments | « src/images/SkImageDecoder.cpp ('k') | src/images/SkImageDecoder_libjpeg.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698