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

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

Issue 129423002: add SkBitmap::installPixelRef() (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 | « no previous file | include/core/SkImageInfo.h » ('j') | include/core/SkImageInfo.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
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 SkBitmap_DEFINED 8 #ifndef SkBitmap_DEFINED
9 #define SkBitmap_DEFINED 9 #define SkBitmap_DEFINED
10 10
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 this if you are handling ownership/lifetime of the pixel memory. 281 this if you are handling ownership/lifetime of the pixel memory.
282 282
283 If the bitmap retains a reference to the colortable (assuming it is 283 If the bitmap retains a reference to the colortable (assuming it is
284 not null) it will take care of incrementing the reference count. 284 not null) it will take care of incrementing the reference count.
285 285
286 @param pixels Address for the pixels, managed by the caller. 286 @param pixels Address for the pixels, managed by the caller.
287 @param ctable ColorTable (or null) that matches the specified pixels 287 @param ctable ColorTable (or null) that matches the specified pixels
288 */ 288 */
289 void setPixels(void* p, SkColorTable* ctable = NULL); 289 void setPixels(void* p, SkColorTable* ctable = NULL);
290 290
291 /**
292 * Install the specified pixelref into the bitmap, with an optional rect
293 * for referencing a subset of the pixels in the pixelref. This sets the
294 * config/width/height/alphatype of the bitmap to match the pixelref.
295 *
296 * The subset rect, if not null, is intersected with the bounds of the
297 * pixelref (taken from its SkImageInfo).
298 */
299 SkPixelRef* installPixelRef(SkPixelRef*, const SkIRect* subset = NULL);
300
291 /** Copies the bitmap's pixels to the location pointed at by dst and returns 301 /** Copies the bitmap's pixels to the location pointed at by dst and returns
292 true if possible, returns false otherwise. 302 true if possible, returns false otherwise.
293 303
294 In the case when the dstRowBytes matches the bitmap's rowBytes, the copy 304 In the case when the dstRowBytes matches the bitmap's rowBytes, the copy
295 may be made faster by copying over the dst's per-row padding (for all 305 may be made faster by copying over the dst's per-row padding (for all
296 rows but the last). By setting preserveDstPad to true the caller can 306 rows but the last). By setting preserveDstPad to true the caller can
297 disable this optimization and ensure that pixels in the padding are not 307 disable this optimization and ensure that pixels in the padding are not
298 overwritten. 308 overwritten.
299 309
300 Always returns false for RLE formats. 310 Always returns false for RLE formats.
(...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after
848 858
849 inline SkPMColor SkBitmap::getIndex8Color(int x, int y) const { 859 inline SkPMColor SkBitmap::getIndex8Color(int x, int y) const {
850 SkASSERT(fPixels); 860 SkASSERT(fPixels);
851 SkASSERT(fConfig == kIndex8_Config); 861 SkASSERT(fConfig == kIndex8_Config);
852 SkASSERT((unsigned)x < fWidth && (unsigned)y < fHeight); 862 SkASSERT((unsigned)x < fWidth && (unsigned)y < fHeight);
853 SkASSERT(fColorTable); 863 SkASSERT(fColorTable);
854 return (*fColorTable)[*((const uint8_t*)fPixels + y * fRowBytes + x)]; 864 return (*fColorTable)[*((const uint8_t*)fPixels + y * fRowBytes + x)];
855 } 865 }
856 866
857 #endif 867 #endif
OLDNEW
« no previous file with comments | « no previous file | include/core/SkImageInfo.h » ('j') | include/core/SkImageInfo.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698