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

Side by Side Diff: include/core/SkPixmap.h

Issue 1776693002: Add deferred texture upload API. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase on sk_skp Created 4 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
« no previous file with comments | « include/core/SkImage.h ('k') | include/gpu/GrContext.h » ('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 #ifndef SkPixmap_DEFINED 8 #ifndef SkPixmap_DEFINED
9 #define SkPixmap_DEFINED 9 #define SkPixmap_DEFINED
10 10
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 /** 204 /**
205 * Allocate memory for the pixels needed to match the specified Info and fi ll out the pixmap 205 * Allocate memory for the pixels needed to match the specified Info and fi ll out the pixmap
206 * to point to that memory. The storage will be freed when this object is d estroyed, 206 * to point to that memory. The storage will be freed when this object is d estroyed,
207 * or if another call to tryAlloc() or alloc() is made. 207 * or if another call to tryAlloc() or alloc() is made.
208 * 208 *
209 * If the memory cannot be allocated, calls sk_throw(). 209 * If the memory cannot be allocated, calls sk_throw().
210 */ 210 */
211 void alloc(const SkImageInfo&); 211 void alloc(const SkImageInfo&);
212 212
213 /** 213 /**
214 * Gets the size and optionally the rowBytes that would be allocated by SkAu toPixmapStorage if
215 * alloc/tryAlloc was called.
216 */
217 static size_t AllocSize(const SkImageInfo& info, size_t* rowBytes);
218
219 /**
214 * Returns an SkData object wrapping the allocated pixels memory, and reset s the pixmap. 220 * Returns an SkData object wrapping the allocated pixels memory, and reset s the pixmap.
215 * If the storage hasn't been allocated, the result is NULL. 221 * If the storage hasn't been allocated, the result is NULL.
216 */ 222 */
217 const SkData* SK_WARN_UNUSED_RESULT detachPixelsAsData(); 223 const SkData* SK_WARN_UNUSED_RESULT detachPixelsAsData();
218 224
219 // We wrap these so we can clear our internal storage 225 // We wrap these so we can clear our internal storage
220 226
221 void reset() { 227 void reset() {
222 this->freeStorage(); 228 this->freeStorage();
223 this->INHERITED::reset(); 229 this->INHERITED::reset();
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 private: 294 private:
289 void (*fUnlockProc)(void*); 295 void (*fUnlockProc)(void*);
290 void* fUnlockContext; 296 void* fUnlockContext;
291 SkPixmap fPixmap; 297 SkPixmap fPixmap;
292 bool fIsLocked; 298 bool fIsLocked;
293 299
294 friend class SkBitmap; 300 friend class SkBitmap;
295 }; 301 };
296 302
297 #endif 303 #endif
OLDNEW
« no previous file with comments | « include/core/SkImage.h ('k') | include/gpu/GrContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698