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

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

Issue 12315131: Make SkTDArray accessors const-friendly (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 9 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/gpu/GrTHashCache.h ('k') | src/pdf/SkPDFDocument.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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 if (fJustBounds) { 61 if (fJustBounds) {
62 return NULL; 62 return NULL;
63 } 63 }
64 64
65 fRGB.setCount(width * height * 3); // 3 == r, g, b 65 fRGB.setCount(width * height * 3); // 3 == r, g, b
66 return fRGB.begin(); 66 return fRGB.begin();
67 } 67 }
68 68
69 int width() const { return fWidth; } 69 int width() const { return fWidth; }
70 int height() const { return fHeight; } 70 int height() const { return fHeight; }
71 uint8_t* rgb() const { return fRGB.begin(); } 71 const uint8_t* rgb() const { return fRGB.begin(); }
72 72
73 private: 73 private:
74 SkTDArray<uint8_t> fRGB; 74 SkTDArray<uint8_t> fRGB;
75 int fWidth; 75 int fWidth;
76 int fHeight; 76 int fHeight;
77 bool fJustBounds; 77 bool fJustBounds;
78 }; 78 };
79 79
80 bool SkBMPImageDecoder::onDecode(SkStream* stream, SkBitmap* bm, Mode mode) { 80 bool SkBMPImageDecoder::onDecode(SkStream* stream, SkBitmap* bm, Mode mode) {
81 81
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 const int dstHeight = sampler.scaledHeight(); 135 const int dstHeight = sampler.scaledHeight();
136 const uint8_t* srcRow = callback.rgb(); 136 const uint8_t* srcRow = callback.rgb();
137 137
138 srcRow += sampler.srcY0() * srcRowBytes; 138 srcRow += sampler.srcY0() * srcRowBytes;
139 for (int y = 0; y < dstHeight; y++) { 139 for (int y = 0; y < dstHeight; y++) {
140 sampler.next(srcRow); 140 sampler.next(srcRow);
141 srcRow += sampler.srcDY() * srcRowBytes; 141 srcRow += sampler.srcDY() * srcRowBytes;
142 } 142 }
143 return true; 143 return true;
144 } 144 }
OLDNEW
« no previous file with comments | « src/gpu/GrTHashCache.h ('k') | src/pdf/SkPDFDocument.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698