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

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

Issue 1217053003: add SkImage::NewFromBitmap (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 5 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
OLDNEW
1 /* 1 /*
2 * Copyright 2012 Google Inc. 2 * Copyright 2012 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 SkImage_DEFINED 8 #ifndef SkImage_DEFINED
9 #define SkImage_DEFINED 9 #define SkImage_DEFINED
10 10
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 * Return a new Image referencing the specified pixels. These must remain v alid and unchanged 55 * Return a new Image referencing the specified pixels. These must remain v alid and unchanged
56 * until the specified release-proc is called, indicating that Skia no long er has a reference 56 * until the specified release-proc is called, indicating that Skia no long er has a reference
57 * to the pixels. 57 * to the pixels.
58 * 58 *
59 * Returns NULL if the requested Info is unsupported. 59 * Returns NULL if the requested Info is unsupported.
60 */ 60 */
61 static SkImage* NewFromRaster(const Info&, const void* pixels, size_t rowByt es, 61 static SkImage* NewFromRaster(const Info&, const void* pixels, size_t rowByt es,
62 RasterReleaseProc, ReleaseContext); 62 RasterReleaseProc, ReleaseContext);
63 63
64 /** 64 /**
65 * Construct a new image from the specified bitmap. If the bitmap is marked immutable, and
robertphillips 2015/07/06 20:43:47 Supposedly "shareable" prevails by a 2:1 margin in
reed2 2015/07/07 01:18:03 Done.
66 * its pixel memory is sharable, it may be shared instead of copied.
67 */
68 static SkImage* NewFromBitmap(const SkBitmap&);
69
70 /**
65 * Construct a new SkImage based on the given ImageGenerator. 71 * Construct a new SkImage based on the given ImageGenerator.
66 * This function will always take ownership of the passed 72 * This function will always take ownership of the passed
67 * ImageGenerator. Returns NULL on error. 73 * ImageGenerator. Returns NULL on error.
68 * 74 *
69 * If a subset is specified, it must be contained within the generator's bo unds. 75 * If a subset is specified, it must be contained within the generator's bo unds.
70 */ 76 */
71 static SkImage* NewFromGenerator(SkImageGenerator*, const SkIRect* subset = NULL); 77 static SkImage* NewFromGenerator(SkImageGenerator*, const SkIRect* subset = NULL);
72 78
73 /** 79 /**
74 * Construct a new SkImage based on the specified encoded data. Returns NUL L on failure, 80 * Construct a new SkImage based on the specified encoded data. Returns NUL L on failure,
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 const int fWidth; 278 const int fWidth;
273 const int fHeight; 279 const int fHeight;
274 const uint32_t fUniqueID; 280 const uint32_t fUniqueID;
275 281
276 static uint32_t NextUniqueID(); 282 static uint32_t NextUniqueID();
277 283
278 typedef SkRefCnt INHERITED; 284 typedef SkRefCnt INHERITED;
279 }; 285 };
280 286
281 #endif 287 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698