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

Side by Side Diff: src/gpu/GrTextureParamsAdjuster.h

Issue 2165703003: Adding an SkColorSpace to SkImage_Gpu (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: s/NULL/nullptr/ Created 4 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 | « src/core/SkSpecialImage.cpp ('k') | src/gpu/SkGr.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 2015 Google Inc. 2 * Copyright 2015 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 GrTextureMaker_DEFINED 8 #ifndef GrTextureMaker_DEFINED
9 #define GrTextureMaker_DEFINED 9 #define GrTextureMaker_DEFINED
10 10
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 FilterConstraint filterConstraint, 65 FilterConstraint filterConstraint,
66 bool coordsLimitedToConstraintRect, 66 bool coordsLimitedToConstraintRect,
67 const GrTextureParams::FilterMode* filterOrN ullForBicubic, 67 const GrTextureParams::FilterMode* filterOrN ullForBicubic,
68 SkSourceGammaTreatment) = 0; 68 SkSourceGammaTreatment) = 0;
69 69
70 virtual ~GrTextureProducer() {} 70 virtual ~GrTextureProducer() {}
71 71
72 int width() const { return fWidth; } 72 int width() const { return fWidth; }
73 int height() const { return fHeight; } 73 int height() const { return fHeight; }
74 bool isAlphaOnly() const { return fIsAlphaOnly; } 74 bool isAlphaOnly() const { return fIsAlphaOnly; }
75 virtual SkColorSpace* getColorSpace() = 0;
75 76
76 protected: 77 protected:
77 GrTextureProducer(int width, int height, bool isAlphaOnly) 78 GrTextureProducer(int width, int height, bool isAlphaOnly)
78 : fWidth(width) 79 : fWidth(width)
79 , fHeight(height) 80 , fHeight(height)
80 , fIsAlphaOnly(isAlphaOnly) {} 81 , fIsAlphaOnly(isAlphaOnly) {}
81 82
82 /** Helper for creating a key for a copy from an original key. */ 83 /** Helper for creating a key for a copy from an original key. */
83 static void MakeCopyKeyFromOrigKey(const GrUniqueKey& origKey, 84 static void MakeCopyKeyFromOrigKey(const GrUniqueKey& origKey,
84 const CopyParams& copyParams, 85 const CopyParams& copyParams,
(...skipping 16 matching lines...) Expand all
101 */ 102 */
102 virtual void makeCopyKey(const CopyParams&, GrUniqueKey* copyKey) = 0; 103 virtual void makeCopyKey(const CopyParams&, GrUniqueKey* copyKey) = 0;
103 104
104 /** 105 /**
105 * If a stretched version of the texture is generated, it may be cached (ass uming that 106 * If a stretched version of the texture is generated, it may be cached (ass uming that
106 * makeCopyKey() returns true). In that case, the maker is notified in case it 107 * makeCopyKey() returns true). In that case, the maker is notified in case it
107 * wants to note that for when the maker is destroyed. 108 * wants to note that for when the maker is destroyed.
108 */ 109 */
109 virtual void didCacheCopy(const GrUniqueKey& copyKey) = 0; 110 virtual void didCacheCopy(const GrUniqueKey& copyKey) = 0;
110 111
111 virtual SkColorSpace* getColorSpace() = 0;
112
113 private: 112 private:
114 const int fWidth; 113 const int fWidth;
115 const int fHeight; 114 const int fHeight;
116 const bool fIsAlphaOnly; 115 const bool fIsAlphaOnly;
117 116
118 typedef SkNoncopyable INHERITED; 117 typedef SkNoncopyable INHERITED;
119 }; 118 };
120 119
121 /** 120 /**
122 * Base class for sources that start out as textures. Optionally allows for a co ntent area subrect. 121 * Base class for sources that start out as textures. Optionally allows for a co ntent area subrect.
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 207
209 GrContext* context() const { return fContext; } 208 GrContext* context() const { return fContext; }
210 209
211 private: 210 private:
212 GrContext* fContext; 211 GrContext* fContext;
213 212
214 typedef GrTextureProducer INHERITED; 213 typedef GrTextureProducer INHERITED;
215 }; 214 };
216 215
217 #endif 216 #endif
OLDNEW
« no previous file with comments | « src/core/SkSpecialImage.cpp ('k') | src/gpu/SkGr.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698