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

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

Issue 20354003: Make SkImage_Gpu share it's pixelref with the surface to prevent premature return to scratch pool. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | src/image/SkImage_Gpu.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
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 struct Info { 58 struct Info {
59 int fWidth; 59 int fWidth;
60 int fHeight; 60 int fHeight;
61 ColorType fColorType; 61 ColorType fColorType;
62 AlphaType fAlphaType; 62 AlphaType fAlphaType;
63 }; 63 };
64 64
65 static SkImage* NewRasterCopy(const Info&, const void* pixels, size_t rowByt es); 65 static SkImage* NewRasterCopy(const Info&, const void* pixels, size_t rowByt es);
66 static SkImage* NewRasterData(const Info&, SkData* pixels, size_t rowBytes); 66 static SkImage* NewRasterData(const Info&, SkData* pixels, size_t rowBytes);
67 static SkImage* NewEncodedData(SkData*); 67 static SkImage* NewEncodedData(SkData*);
68 static SkImage* NewTexture(GrTexture*); 68
69 /**
70 * GrTexture is a more logical parameter for this factory, but its
71 * interactions with scratch cache still has issues, so for now we take
72 * SkBitmap instead. This will be changed in the future. skbug.com/1449
73 */
74 static SkImage* NewTexture(const SkBitmap&);
69 75
70 int width() const { return fWidth; } 76 int width() const { return fWidth; }
71 int height() const { return fHeight; } 77 int height() const { return fHeight; }
72 uint32_t uniqueID() const { return fUniqueID; } 78 uint32_t uniqueID() const { return fUniqueID; }
73 79
74 /** 80 /**
75 * Return the GrTexture that stores the image pixels. Calling getTexture 81 * Return the GrTexture that stores the image pixels. Calling getTexture
76 * does not affect the reference count of the GrTexture object. 82 * does not affect the reference count of the GrTexture object.
77 * Will return NULL if the image does not use a texture. 83 * Will return NULL if the image does not use a texture.
78 */ 84 */
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 const int fWidth; 122 const int fWidth;
117 const int fHeight; 123 const int fHeight;
118 const uint32_t fUniqueID; 124 const uint32_t fUniqueID;
119 125
120 static uint32_t NextUniqueID(); 126 static uint32_t NextUniqueID();
121 127
122 typedef SkRefCnt INHERITED; 128 typedef SkRefCnt INHERITED;
123 }; 129 };
124 130
125 #endif 131 #endif
OLDNEW
« no previous file with comments | « no previous file | src/image/SkImage_Gpu.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698