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

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

Issue 608883003: GrResourceCache2 manages scratch texture. (Closed) Base URL: https://skia.googlesource.com/skia.git@surfimpl
Patch Set: remove todo Created 6 years, 2 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/gpu/GrGpuResourceRef.cpp ('k') | src/gpu/GrLayerCache.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 2011 Google Inc. 2 * Copyright 2011 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 GrInOrderDrawBuffer_DEFINED 8 #ifndef GrInOrderDrawBuffer_DEFINED
9 #define GrInOrderDrawBuffer_DEFINED 9 #define GrInOrderDrawBuffer_DEFINED
10 10
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 public: 102 public:
103 Draw(const DrawInfo& info, const GrVertexBuffer* vb, const GrIndexBuffer * ib) 103 Draw(const DrawInfo& info, const GrVertexBuffer* vb, const GrIndexBuffer * ib)
104 : DrawInfo(info) 104 : DrawInfo(info)
105 , fVertexBuffer(vb) 105 , fVertexBuffer(vb)
106 , fIndexBuffer(ib) {} 106 , fIndexBuffer(ib) {}
107 107
108 const GrVertexBuffer* vertexBuffer() const { return fVertexBuffer.get(); } 108 const GrVertexBuffer* vertexBuffer() const { return fVertexBuffer.get(); }
109 const GrIndexBuffer* indexBuffer() const { return fIndexBuffer.get(); } 109 const GrIndexBuffer* indexBuffer() const { return fIndexBuffer.get(); }
110 110
111 private: 111 private:
112 GrPendingIOResource<const GrVertexBuffer, GrIORef::kRead_IOType> fVer texBuffer; 112 GrPendingIOResource<const GrVertexBuffer, kRead_GrIOType> fVertexBuff er;
113 GrPendingIOResource<const GrIndexBuffer, GrIORef::kRead_IOType> fInd exBuffer; 113 GrPendingIOResource<const GrIndexBuffer, kRead_GrIOType> fIndexBuffe r;
114 }; 114 };
115 115
116 struct StencilPath : public ::SkNoncopyable { 116 struct StencilPath : public ::SkNoncopyable {
117 StencilPath(const GrPath* path) : fPath(path) {} 117 StencilPath(const GrPath* path) : fPath(path) {}
118 118
119 const GrPath* path() const { return fPath.get(); } 119 const GrPath* path() const { return fPath.get(); }
120 120
121 SkPath::FillType fFill; 121 SkPath::FillType fFill;
122 122
123 private: 123 private:
124 GrPendingIOResource<const GrPath, GrIORef::kRead_IOType> fPath; 124 GrPendingIOResource<const GrPath, kRead_GrIOType> fPath;
125 }; 125 };
126 126
127 struct DrawPath : public ::SkNoncopyable { 127 struct DrawPath : public ::SkNoncopyable {
128 DrawPath(const GrPath* path) : fPath(path) {} 128 DrawPath(const GrPath* path) : fPath(path) {}
129 129
130 const GrPath* path() const { return fPath.get(); } 130 const GrPath* path() const { return fPath.get(); }
131 131
132 SkPath::FillType fFill; 132 SkPath::FillType fFill;
133 GrDeviceCoordTexture fDstCopy; 133 GrDeviceCoordTexture fDstCopy;
134 134
135 private: 135 private:
136 GrPendingIOResource<const GrPath, GrIORef::kRead_IOType> fPath; 136 GrPendingIOResource<const GrPath, kRead_GrIOType> fPath;
137 }; 137 };
138 138
139 struct DrawPaths : public ::SkNoncopyable { 139 struct DrawPaths : public ::SkNoncopyable {
140 DrawPaths(const GrPathRange* pathRange) 140 DrawPaths(const GrPathRange* pathRange)
141 : fPathRange(pathRange) {} 141 : fPathRange(pathRange) {}
142 142
143 ~DrawPaths() { 143 ~DrawPaths() {
144 if (fTransforms) { 144 if (fTransforms) {
145 SkDELETE_ARRAY(fTransforms); 145 SkDELETE_ARRAY(fTransforms);
146 } 146 }
147 if (fIndices) { 147 if (fIndices) {
148 SkDELETE_ARRAY(fIndices); 148 SkDELETE_ARRAY(fIndices);
149 } 149 }
150 } 150 }
151 151
152 const GrPathRange* pathRange() const { return fPathRange.get(); } 152 const GrPathRange* pathRange() const { return fPathRange.get(); }
153 153
154 uint32_t* fIndices; 154 uint32_t* fIndices;
155 size_t fCount; 155 size_t fCount;
156 float* fTransforms; 156 float* fTransforms;
157 PathTransformType fTransformsType; 157 PathTransformType fTransformsType;
158 SkPath::FillType fFill; 158 SkPath::FillType fFill;
159 GrDeviceCoordTexture fDstCopy; 159 GrDeviceCoordTexture fDstCopy;
160 160
161 private: 161 private:
162 GrPendingIOResource<const GrPathRange, GrIORef::kRead_IOType> fPathRange ; 162 GrPendingIOResource<const GrPathRange, kRead_GrIOType> fPathRange;
163 }; 163 };
164 164
165 // This is also used to record a discard by setting the color to GrColor_ILL EGAL 165 // This is also used to record a discard by setting the color to GrColor_ILL EGAL
166 struct Clear : public ::SkNoncopyable { 166 struct Clear : public ::SkNoncopyable {
167 Clear(GrRenderTarget* rt) : fRenderTarget(rt) {} 167 Clear(GrRenderTarget* rt) : fRenderTarget(rt) {}
168 ~Clear() { } 168 ~Clear() { }
169 GrRenderTarget* renderTarget() const { return fRenderTarget.get(); } 169 GrRenderTarget* renderTarget() const { return fRenderTarget.get(); }
170 170
171 SkIRect fRect; 171 SkIRect fRect;
172 GrColor fColor; 172 GrColor fColor;
173 bool fCanIgnoreRect; 173 bool fCanIgnoreRect;
174 174
175 private: 175 private:
176 GrPendingIOResource<GrRenderTarget, GrIORef::kWrite_IOType> fRenderTarge t; 176 GrPendingIOResource<GrRenderTarget, kWrite_GrIOType> fRenderTarget;
177 }; 177 };
178 178
179 struct CopySurface : public ::SkNoncopyable { 179 struct CopySurface : public ::SkNoncopyable {
180 CopySurface(GrSurface* dst, GrSurface* src) : fDst(dst), fSrc(src) {} 180 CopySurface(GrSurface* dst, GrSurface* src) : fDst(dst), fSrc(src) {}
181 181
182 GrSurface* dst() const { return fDst.get(); } 182 GrSurface* dst() const { return fDst.get(); }
183 GrSurface* src() const { return fSrc.get(); } 183 GrSurface* src() const { return fSrc.get(); }
184 184
185 SkIPoint fDstPoint; 185 SkIPoint fDstPoint;
186 SkIRect fSrcRect; 186 SkIRect fSrcRect;
187 187
188 private: 188 private:
189 GrPendingIOResource<GrSurface, GrIORef::kWrite_IOType> fDst; 189 GrPendingIOResource<GrSurface, kWrite_GrIOType> fDst;
190 GrPendingIOResource<GrSurface, GrIORef::kRead_IOType> fSrc; 190 GrPendingIOResource<GrSurface, kRead_GrIOType> fSrc;
191 }; 191 };
192 192
193 struct Clip : public ::SkNoncopyable { 193 struct Clip : public ::SkNoncopyable {
194 SkClipStack fStack; 194 SkClipStack fStack;
195 SkIPoint fOrigin; 195 SkIPoint fOrigin;
196 }; 196 };
197 197
198 // overrides from GrDrawTarget 198 // overrides from GrDrawTarget
199 virtual void onDraw(const DrawInfo&) SK_OVERRIDE; 199 virtual void onDraw(const DrawInfo&) SK_OVERRIDE;
200 virtual void onDrawRect(const SkRect& rect, 200 virtual void onDrawRect(const SkRect& rect,
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 typedef SkSTArray<kGeoPoolStatePreAllocCnt, GeometryPoolState> GeoPoolStateS tack; 325 typedef SkSTArray<kGeoPoolStatePreAllocCnt, GeometryPoolState> GeoPoolStateS tack;
326 326
327 GeoPoolStateStack fGeoPoolStateStack; 327 GeoPoolStateStack fGeoPoolStateStack;
328 bool fFlushing; 328 bool fFlushing;
329 uint32_t fDrawID; 329 uint32_t fDrawID;
330 330
331 typedef GrDrawTarget INHERITED; 331 typedef GrDrawTarget INHERITED;
332 }; 332 };
333 333
334 #endif 334 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrGpuResourceRef.cpp ('k') | src/gpu/GrLayerCache.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698