OLD | NEW |
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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 GrPendingIOResource<const GrIndexBuffer, kRead_GrIOType> fIndexBuffe
r; | 132 GrPendingIOResource<const GrIndexBuffer, kRead_GrIOType> fIndexBuffe
r; |
133 }; | 133 }; |
134 | 134 |
135 struct StencilPath : public Cmd { | 135 struct StencilPath : public Cmd { |
136 StencilPath(const GrPath* path) : Cmd(kStencilPath_Cmd), fPath(path) {} | 136 StencilPath(const GrPath* path) : Cmd(kStencilPath_Cmd), fPath(path) {} |
137 | 137 |
138 const GrPath* path() const { return fPath.get(); } | 138 const GrPath* path() const { return fPath.get(); } |
139 | 139 |
140 virtual void execute(GrClipTarget*); | 140 virtual void execute(GrClipTarget*); |
141 | 141 |
142 SkPath::FillType fFill; | 142 GrPathRendering::FillType fFill; |
143 | 143 |
144 private: | 144 private: |
145 GrPendingIOResource<const GrPath, kRead_GrIOType> fPath; | 145 GrPendingIOResource<const GrPath, kRead_GrIOType> fPath; |
146 }; | 146 }; |
147 | 147 |
148 struct DrawPath : public Cmd { | 148 struct DrawPath : public Cmd { |
149 DrawPath(const GrPath* path) : Cmd(kDrawPath_Cmd), fPath(path) {} | 149 DrawPath(const GrPath* path) : Cmd(kDrawPath_Cmd), fPath(path) {} |
150 | 150 |
151 const GrPath* path() const { return fPath.get(); } | 151 const GrPath* path() const { return fPath.get(); } |
152 | 152 |
153 virtual void execute(GrClipTarget*); | 153 virtual void execute(GrClipTarget*); |
154 | 154 |
155 SkPath::FillType fFill; | 155 GrPathRendering::FillType fFill; |
156 GrDeviceCoordTexture fDstCopy; | 156 GrDeviceCoordTexture fDstCopy; |
157 | 157 |
158 private: | 158 private: |
159 GrPendingIOResource<const GrPath, kRead_GrIOType> fPath; | 159 GrPendingIOResource<const GrPath, kRead_GrIOType> fPath; |
160 }; | 160 }; |
161 | 161 |
162 struct DrawPaths : public Cmd { | 162 struct DrawPaths : public Cmd { |
163 DrawPaths(const GrPathRange* pathRange) : Cmd(kDrawPaths_Cmd), fPathRang
e(pathRange) {} | 163 DrawPaths(const GrPathRange* pathRange) : Cmd(kDrawPaths_Cmd), fPathRang
e(pathRange) {} |
164 | 164 |
165 const GrPathRange* pathRange() const { return fPathRange.get(); } | 165 const GrPathRange* pathRange() const { return fPathRange.get(); } |
166 uint32_t* indices() { return reinterpret_cast<uint32_t*>(CmdBuffer::GetD
ataForItem(this)); } | 166 uint32_t* indices() { return reinterpret_cast<uint32_t*>(CmdBuffer::GetD
ataForItem(this)); } |
167 float* transforms() { return reinterpret_cast<float*>(&this->indices()[f
Count]); } | 167 float* transforms() { return reinterpret_cast<float*>(&this->indices()[f
Count]); } |
168 | 168 |
169 virtual void execute(GrClipTarget*); | 169 virtual void execute(GrClipTarget*); |
170 | 170 |
171 size_t fCount; | 171 size_t fCount; |
172 PathTransformType fTransformsType; | 172 PathTransformType fTransformsType; |
173 SkPath::FillType fFill; | 173 GrPathRendering::FillType fFill; |
174 GrDeviceCoordTexture fDstCopy; | 174 GrDeviceCoordTexture fDstCopy; |
175 | 175 |
176 private: | 176 private: |
177 GrPendingIOResource<const GrPathRange, kRead_GrIOType> fPathRange; | 177 GrPendingIOResource<const GrPathRange, kRead_GrIOType> fPathRange; |
178 }; | 178 }; |
179 | 179 |
180 // This is also used to record a discard by setting the color to GrColor_ILL
EGAL | 180 // This is also used to record a discard by setting the color to GrColor_ILL
EGAL |
181 struct Clear : public Cmd { | 181 struct Clear : public Cmd { |
182 Clear(GrRenderTarget* rt) : Cmd(kClear_Cmd), fRenderTarget(rt) {} | 182 Clear(GrRenderTarget* rt) : Cmd(kClear_Cmd), fRenderTarget(rt) {} |
183 | 183 |
184 GrRenderTarget* renderTarget() const { return fRenderTarget.get(); } | 184 GrRenderTarget* renderTarget() const { return fRenderTarget.get(); } |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 | 250 |
251 typedef void* TCmdAlign; // This wouldn't be enough align if a command used
long double. | 251 typedef void* TCmdAlign; // This wouldn't be enough align if a command used
long double. |
252 typedef GrTRecorder<Cmd, TCmdAlign> CmdBuffer; | 252 typedef GrTRecorder<Cmd, TCmdAlign> CmdBuffer; |
253 | 253 |
254 // overrides from GrDrawTarget | 254 // overrides from GrDrawTarget |
255 virtual void onDraw(const DrawInfo&) SK_OVERRIDE; | 255 virtual void onDraw(const DrawInfo&) SK_OVERRIDE; |
256 virtual void onDrawRect(const SkRect& rect, | 256 virtual void onDrawRect(const SkRect& rect, |
257 const SkRect* localRect, | 257 const SkRect* localRect, |
258 const SkMatrix* localMatrix) SK_OVERRIDE; | 258 const SkMatrix* localMatrix) SK_OVERRIDE; |
259 | 259 |
260 virtual void onStencilPath(const GrPath*, SkPath::FillType) SK_OVERRIDE; | 260 virtual void onStencilPath(const GrPath*, GrPathRendering::FillType) SK_OVER
RIDE; |
261 virtual void onDrawPath(const GrPath*, SkPath::FillType, | 261 virtual void onDrawPath(const GrPath*, GrPathRendering::FillType, |
262 const GrDeviceCoordTexture* dstCopy) SK_OVERRIDE; | 262 const GrDeviceCoordTexture* dstCopy) SK_OVERRIDE; |
263 virtual void onDrawPaths(const GrPathRange*, | 263 virtual void onDrawPaths(const GrPathRange*, |
264 const uint32_t indices[], int count, | 264 const uint32_t indices[], int count, |
265 const float transforms[], PathTransformType, | 265 const float transforms[], PathTransformType, |
266 SkPath::FillType, const GrDeviceCoordTexture*) SK_O
VERRIDE; | 266 GrPathRendering::FillType, const GrDeviceCoordTextu
re*) SK_OVERRIDE; |
267 | 267 |
268 virtual bool onReserveVertexSpace(size_t vertexSize, | 268 virtual bool onReserveVertexSpace(size_t vertexSize, |
269 int vertexCount, | 269 int vertexCount, |
270 void** vertices) SK_OVERRIDE; | 270 void** vertices) SK_OVERRIDE; |
271 virtual bool onReserveIndexSpace(int indexCount, | 271 virtual bool onReserveIndexSpace(int indexCount, |
272 void** indices) SK_OVERRIDE; | 272 void** indices) SK_OVERRIDE; |
273 virtual void releaseReservedVertexSpace() SK_OVERRIDE; | 273 virtual void releaseReservedVertexSpace() SK_OVERRIDE; |
274 virtual void releaseReservedIndexSpace() SK_OVERRIDE; | 274 virtual void releaseReservedIndexSpace() SK_OVERRIDE; |
275 virtual void onSetVertexSourceToArray(const void* vertexArray, | 275 virtual void onSetVertexSourceToArray(const void* vertexArray, |
276 int vertexCount) SK_OVERRIDE; | 276 int vertexCount) SK_OVERRIDE; |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 typedef SkSTArray<kGeoPoolStatePreAllocCnt, GeometryPoolState> GeoPoolStateS
tack; | 349 typedef SkSTArray<kGeoPoolStatePreAllocCnt, GeometryPoolState> GeoPoolStateS
tack; |
350 | 350 |
351 GeoPoolStateStack fGeoPoolStateStack; | 351 GeoPoolStateStack fGeoPoolStateStack; |
352 bool fFlushing; | 352 bool fFlushing; |
353 uint32_t fDrawID; | 353 uint32_t fDrawID; |
354 | 354 |
355 typedef GrClipTarget INHERITED; | 355 typedef GrClipTarget INHERITED; |
356 }; | 356 }; |
357 | 357 |
358 #endif | 358 #endif |
OLD | NEW |