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

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

Issue 406673003: Add the method isOpaque() to SkImage (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 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
« no previous file with comments | « no previous file | src/image/SkImage_Codec.cpp » ('j') | src/image/SkImage_Codec.cpp » ('J')
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
(...skipping 29 matching lines...) Expand all
40 static SkImage* NewRasterData(const Info&, SkData* pixels, size_t rowBytes); 40 static SkImage* NewRasterData(const Info&, SkData* pixels, size_t rowBytes);
41 static SkImage* NewEncodedData(SkData*); 41 static SkImage* NewEncodedData(SkData*);
42 42
43 /** 43 /**
44 * GrTexture is a more logical parameter for this factory, but its 44 * GrTexture is a more logical parameter for this factory, but its
45 * 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
46 * 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
47 */ 47 */
48 static SkImage* NewTexture(const SkBitmap&); 48 static SkImage* NewTexture(const SkBitmap&);
49 49
50 virtual bool isOpaque() const { return false; }
51
50 int width() const { return fWidth; } 52 int width() const { return fWidth; }
51 int height() const { return fHeight; } 53 int height() const { return fHeight; }
52 uint32_t uniqueID() const { return fUniqueID; } 54 uint32_t uniqueID() const { return fUniqueID; }
53 55
54 /** 56 /**
55 * Return the GrTexture that stores the image pixels. Calling getTexture 57 * Return the GrTexture that stores the image pixels. Calling getTexture
56 * does not affect the reference count of the GrTexture object. 58 * does not affect the reference count of the GrTexture object.
57 * Will return NULL if the image does not use a texture. 59 * Will return NULL if the image does not use a texture.
58 */ 60 */
59 GrTexture* getTexture(); 61 GrTexture* getTexture();
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 * On failure, false will be returned, and bitmap will unmodified. 131 * On failure, false will be returned, and bitmap will unmodified.
130 */ 132 */
131 // On ice for now: 133 // On ice for now:
132 // - should it respect the particular colortype/alphatype of the src 134 // - should it respect the particular colortype/alphatype of the src
133 // - should it have separate entrypoints for preallocated and not bitmaps? 135 // - should it have separate entrypoints for preallocated and not bitmaps?
134 // - 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?
135 bool readPixels(SkBitmap* bitmap, const SkIRect* subset = NULL) const; 137 bool readPixels(SkBitmap* bitmap, const SkIRect* subset = NULL) const;
136 }; 138 };
137 139
138 #endif 140 #endif
OLDNEW
« no previous file with comments | « no previous file | src/image/SkImage_Codec.cpp » ('j') | src/image/SkImage_Codec.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698