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

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

Issue 834633006: add ImageGenerator::NewFromData to porting layer (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add helper for SkInstallDiscardablePixelRef(SkData*, ...) Created 5 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
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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 56
57 virtual bool isOpaque() const { return false; } 57 virtual bool isOpaque() const { return false; }
58 58
59 /** 59 /**
60 * Construct a new SkImage based on the given ImageGenerator. 60 * Construct a new SkImage based on the given ImageGenerator.
61 * This function will always take ownership of the passed 61 * This function will always take ownership of the passed
62 * ImageGenerator. Returns NULL on error. 62 * ImageGenerator. Returns NULL on error.
63 */ 63 */
64 static SkImage* NewFromGenerator(SkImageGenerator*); 64 static SkImage* NewFromGenerator(SkImageGenerator*);
65 65
66 /**
67 * Construct a new SkImage based on the specified encoded data. Returns NUL L on failure,
68 * which can mean that the format of the encoded data was not recognized/su pported.
69 *
70 * Regardless of success or failure, the caller is responsible for managing their ownership
71 * of the data.
72 */
73 static SkImage* NewFromData(SkData* data);
74
66 int width() const { return fWidth; } 75 int width() const { return fWidth; }
67 int height() const { return fHeight; } 76 int height() const { return fHeight; }
68 uint32_t uniqueID() const { return fUniqueID; } 77 uint32_t uniqueID() const { return fUniqueID; }
69 78
70 /** 79 /**
71 * Return the GrTexture that stores the image pixels. Calling getTexture 80 * Return the GrTexture that stores the image pixels. Calling getTexture
72 * does not affect the reference count of the GrTexture object. 81 * does not affect the reference count of the GrTexture object.
73 * Will return NULL if the image does not use a texture. 82 * Will return NULL if the image does not use a texture.
74 */ 83 */
75 GrTexture* getTexture(); 84 GrTexture* getTexture();
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 * Draw the image, cropped to the src rect, to the dst rect of a canvas. 167 * Draw the image, cropped to the src rect, to the dst rect of a canvas.
159 * If src is larger than the bounds of the image, the rest of the image is 168 * If src is larger than the bounds of the image, the rest of the image is
160 * filled with transparent black pixels. 169 * filled with transparent black pixels.
161 * 170 *
162 * See SkCanvas::drawBitmapRectToRect for similar behavior. 171 * See SkCanvas::drawBitmapRectToRect for similar behavior.
163 */ 172 */
164 void drawRect(SkCanvas*, const SkRect* src, const SkRect& dst, const SkPaint *) const; 173 void drawRect(SkCanvas*, const SkRect* src, const SkRect& dst, const SkPaint *) const;
165 }; 174 };
166 175
167 #endif 176 #endif
OLDNEW
« no previous file with comments | « gyp/images.gyp ('k') | include/core/SkImageGenerator.h » ('j') | include/core/SkImageGenerator.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698