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

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

Issue 453723003: Revert of SkImage::NewFromGenerator(SkImageGenerator*), and a unit test. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 4 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 | « gyp/core.gyp ('k') | src/image/SkImage_Raster.cpp » ('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 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
11 #include "SkImageInfo.h" 11 #include "SkImageInfo.h"
12 #include "SkImageEncoder.h" 12 #include "SkImageEncoder.h"
13 #include "SkRefCnt.h" 13 #include "SkRefCnt.h"
14 #include "SkScalar.h" 14 #include "SkScalar.h"
15 #include "SkShader.h" 15 #include "SkShader.h"
16 16
17 class SkData; 17 class SkData;
18 class SkCanvas; 18 class SkCanvas;
19 class SkImageGenerator;
20 class SkPaint; 19 class SkPaint;
21 class GrContext; 20 class GrContext;
22 class GrTexture; 21 class GrTexture;
23 22
24 /** 23 /**
25 * SkImage is an abstraction for drawing a rectagle of pixels, though the 24 * SkImage is an abstraction for drawing a rectagle of pixels, though the
26 * particular type of image could be actually storing its data on the GPU, or 25 * particular type of image could be actually storing its data on the GPU, or
27 * as drawing commands (picture or PDF or otherwise), ready to be played back 26 * as drawing commands (picture or PDF or otherwise), ready to be played back
28 * into another canvas. 27 * into another canvas.
29 * 28 *
(...skipping 11 matching lines...) Expand all
41 static SkImage* NewRasterData(const Info&, SkData* pixels, size_t rowBytes); 40 static SkImage* NewRasterData(const Info&, SkData* pixels, size_t rowBytes);
42 static SkImage* NewEncodedData(SkData*); 41 static SkImage* NewEncodedData(SkData*);
43 42
44 /** 43 /**
45 * GrTexture is a more logical parameter for this factory, but its 44 * GrTexture is a more logical parameter for this factory, but its
46 * interactions with scratch cache still has issues, so for now we take 45 * interactions with scratch cache still has issues, so for now we take
47 * SkBitmap instead. This will be changed in the future. skbug.com/1449 46 * SkBitmap instead. This will be changed in the future. skbug.com/1449
48 */ 47 */
49 static SkImage* NewTexture(const SkBitmap&); 48 static SkImage* NewTexture(const SkBitmap&);
50 49
51 /**
52 * Construct a new SkImage based on the given ImageGenerator.
53 * This function will always take ownership of the passed
54 * ImageGenerator. Returns NULL on error.
55 */
56 static SkImage* NewFromGenerator(SkImageGenerator*);
57
58 int width() const { return fWidth; } 50 int width() const { return fWidth; }
59 int height() const { return fHeight; } 51 int height() const { return fHeight; }
60 uint32_t uniqueID() const { return fUniqueID; } 52 uint32_t uniqueID() const { return fUniqueID; }
61 53
62 /** 54 /**
63 * Return the GrTexture that stores the image pixels. Calling getTexture 55 * Return the GrTexture that stores the image pixels. Calling getTexture
64 * does not affect the reference count of the GrTexture object. 56 * does not affect the reference count of the GrTexture object.
65 * Will return NULL if the image does not use a texture. 57 * Will return NULL if the image does not use a texture.
66 */ 58 */
67 GrTexture* getTexture(); 59 GrTexture* getTexture();
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 * On failure, false will be returned, and bitmap will unmodified. 131 * On failure, false will be returned, and bitmap will unmodified.
140 */ 132 */
141 // On ice for now: 133 // On ice for now:
142 // - should it respect the particular colortype/alphatype of the src 134 // - should it respect the particular colortype/alphatype of the src
143 // - should it have separate entrypoints for preallocated and not bitmaps? 135 // - should it have separate entrypoints for preallocated and not bitmaps?
144 // - isn't it enough to allow the caller to draw() the image into a canvas? 136 // - isn't it enough to allow the caller to draw() the image into a canvas?
145 bool readPixels(SkBitmap* bitmap, const SkIRect* subset = NULL) const; 137 bool readPixels(SkBitmap* bitmap, const SkIRect* subset = NULL) const;
146 }; 138 };
147 139
148 #endif 140 #endif
OLDNEW
« no previous file with comments | « gyp/core.gyp ('k') | src/image/SkImage_Raster.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698