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

Side by Side Diff: src/core/SkMallocPixelRef.cpp

Issue 123223007: Revert "Revert "Revert "Revert of https://codereview.chromium.org/110593003/""" (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: fix compatibility mode for onLockPixels by pre-nulling colortable Created 6 years, 11 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/core/SkBitmapDevice.cpp ('k') | src/core/SkPixelRef.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 * Copyright 2011 Google Inc. 2 * Copyright 2011 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 "SkMallocPixelRef.h" 8 #include "SkMallocPixelRef.h"
9 #include "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkFlattenableBuffers.h" 10 #include "SkFlattenableBuffers.h"
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 } 179 }
180 180
181 181
182 SkMallocPixelRef::~SkMallocPixelRef() { 182 SkMallocPixelRef::~SkMallocPixelRef() {
183 SkSafeUnref(fCTable); 183 SkSafeUnref(fCTable);
184 if (fReleaseProc != NULL) { 184 if (fReleaseProc != NULL) {
185 fReleaseProc(fStorage, fReleaseProcContext); 185 fReleaseProc(fStorage, fReleaseProcContext);
186 } 186 }
187 } 187 }
188 188
189 void* SkMallocPixelRef::onLockPixels(SkColorTable** ctable) { 189 bool SkMallocPixelRef::onNewLockPixels(LockRec* rec) {
190 *ctable = fCTable; 190 rec->fPixels = fStorage;
191 return fStorage; 191 rec->fRowBytes = fRB;
192 rec->fColorTable = fCTable;
193 return true;
192 } 194 }
193 195
194 void SkMallocPixelRef::onUnlockPixels() { 196 void SkMallocPixelRef::onUnlockPixels() {
195 // nothing to do 197 // nothing to do
196 } 198 }
197 199
198 size_t SkMallocPixelRef::getAllocatedSizeInBytes() const { 200 size_t SkMallocPixelRef::getAllocatedSizeInBytes() const {
199 return this->info().getSafeSize(fRB); 201 return this->info().getSafeSize(fRB);
200 } 202 }
201 203
(...skipping 27 matching lines...) Expand all
229 } 231 }
230 232
231 if (buffer.readBool()) { 233 if (buffer.readBool()) {
232 fCTable = SkNEW_ARGS(SkColorTable, (buffer)); 234 fCTable = SkNEW_ARGS(SkColorTable, (buffer));
233 } else { 235 } else {
234 fCTable = NULL; 236 fCTable = NULL;
235 } 237 }
236 238
237 this->setPreLocked(fStorage, fRB, fCTable); 239 this->setPreLocked(fStorage, fRB, fCTable);
238 } 240 }
OLDNEW
« no previous file with comments | « src/core/SkBitmapDevice.cpp ('k') | src/core/SkPixelRef.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698