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

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

Issue 125063002: add rowBytes param to setPreLock, in prep for onNewLockPixels change (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: 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/SkMallocPixelRef.cpp ('k') | no next file » | 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 2011 Google Inc. 3 * Copyright 2011 Google Inc.
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 #include "SkPixelRef.h" 8 #include "SkPixelRef.h"
9 #include "SkFlattenableBuffers.h" 9 #include "SkFlattenableBuffers.h"
10 #include "SkThread.h" 10 #include "SkThread.h"
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 fUniqueGenerationID = false; 131 fUniqueGenerationID = false;
132 } 132 }
133 133
134 void SkPixelRef::cloneGenID(const SkPixelRef& that) { 134 void SkPixelRef::cloneGenID(const SkPixelRef& that) {
135 // This is subtle. We must call that.getGenerationID() to make sure its gen ID isn't 0. 135 // This is subtle. We must call that.getGenerationID() to make sure its gen ID isn't 0.
136 this->fGenerationID = that.getGenerationID(); 136 this->fGenerationID = that.getGenerationID();
137 this->fUniqueGenerationID = false; 137 this->fUniqueGenerationID = false;
138 that.fUniqueGenerationID = false; 138 that.fUniqueGenerationID = false;
139 } 139 }
140 140
141 void SkPixelRef::setPreLocked(void* pixels, SkColorTable* ctable) { 141 // rowBytes will be respected when we land the onNewLockPixels CL
142 void SkPixelRef::setPreLocked(void* pixels, size_t rowBytes, SkColorTable* ctabl e) {
142 #ifndef SK_IGNORE_PIXELREF_SETPRELOCKED 143 #ifndef SK_IGNORE_PIXELREF_SETPRELOCKED
143 // only call me in your constructor, otherwise fLockCount tracking can get 144 // only call me in your constructor, otherwise fLockCount tracking can get
144 // out of sync. 145 // out of sync.
145 fPixels = pixels; 146 fPixels = pixels;
146 fColorTable = ctable; 147 fColorTable = ctable;
147 fLockCount = SKPIXELREF_PRELOCKED_LOCKCOUNT; 148 fLockCount = SKPIXELREF_PRELOCKED_LOCKCOUNT;
148 fPreLocked = true; 149 fPreLocked = true;
149 #endif 150 #endif
150 } 151 }
151 152
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 281
281 #ifdef SK_BUILD_FOR_ANDROID 282 #ifdef SK_BUILD_FOR_ANDROID
282 void SkPixelRef::globalRef(void* data) { 283 void SkPixelRef::globalRef(void* data) {
283 this->ref(); 284 this->ref();
284 } 285 }
285 286
286 void SkPixelRef::globalUnref() { 287 void SkPixelRef::globalUnref() {
287 this->unref(); 288 this->unref();
288 } 289 }
289 #endif 290 #endif
OLDNEW
« no previous file with comments | « src/core/SkMallocPixelRef.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698