| 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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 GrPendingIOResource<const GrPath, kRead_GrIOType> fPath; | 136 GrPendingIOResource<const GrPath, kRead_GrIOType> fPath; |
| 137 }; | 137 }; |
| 138 | 138 |
| 139 struct DrawPath : public Cmd { | 139 struct DrawPath : public Cmd { |
| 140 DrawPath(const GrPath* path) : Cmd(kDrawPath_Cmd), fPath(path) {} | 140 DrawPath(const GrPath* path) : Cmd(kDrawPath_Cmd), fPath(path) {} |
| 141 | 141 |
| 142 const GrPath* path() const { return fPath.get(); } | 142 const GrPath* path() const { return fPath.get(); } |
| 143 | 143 |
| 144 virtual void execute(GrInOrderDrawBuffer*, const GrOptDrawState*); | 144 virtual void execute(GrInOrderDrawBuffer*, const GrOptDrawState*); |
| 145 | 145 |
| 146 GrDeviceCoordTexture fDstCopy; | |
| 147 GrStencilSettings fStencilSettings; | 146 GrStencilSettings fStencilSettings; |
| 148 | 147 |
| 149 private: | 148 private: |
| 150 GrPendingIOResource<const GrPath, kRead_GrIOType> fPath; | 149 GrPendingIOResource<const GrPath, kRead_GrIOType> fPath; |
| 151 }; | 150 }; |
| 152 | 151 |
| 153 struct DrawPaths : public Cmd { | 152 struct DrawPaths : public Cmd { |
| 154 DrawPaths(const GrPathRange* pathRange) : Cmd(kDrawPaths_Cmd), fPathRang
e(pathRange) {} | 153 DrawPaths(const GrPathRange* pathRange) : Cmd(kDrawPaths_Cmd), fPathRang
e(pathRange) {} |
| 155 | 154 |
| 156 const GrPathRange* pathRange() const { return fPathRange.get(); } | 155 const GrPathRange* pathRange() const { return fPathRange.get(); } |
| 157 | 156 |
| 158 virtual void execute(GrInOrderDrawBuffer*, const GrOptDrawState*); | 157 virtual void execute(GrInOrderDrawBuffer*, const GrOptDrawState*); |
| 159 | 158 |
| 160 int fIndicesLocation; | 159 int fIndicesLocation; |
| 161 size_t fCount; | 160 size_t fCount; |
| 162 int fTransformsLocation; | 161 int fTransformsLocation; |
| 163 PathTransformType fTransformsType; | 162 PathTransformType fTransformsType; |
| 164 GrDeviceCoordTexture fDstCopy; | |
| 165 GrStencilSettings fStencilSettings; | 163 GrStencilSettings fStencilSettings; |
| 166 | 164 |
| 167 private: | 165 private: |
| 168 GrPendingIOResource<const GrPathRange, kRead_GrIOType> fPathRange; | 166 GrPendingIOResource<const GrPathRange, kRead_GrIOType> fPathRange; |
| 169 }; | 167 }; |
| 170 | 168 |
| 171 // This is also used to record a discard by setting the color to GrColor_ILL
EGAL | 169 // This is also used to record a discard by setting the color to GrColor_ILL
EGAL |
| 172 struct Clear : public Cmd { | 170 struct Clear : public Cmd { |
| 173 Clear(GrRenderTarget* rt) : Cmd(kClear_Cmd), fRenderTarget(rt) {} | 171 Clear(GrRenderTarget* rt) : Cmd(kClear_Cmd), fRenderTarget(rt) {} |
| 174 | 172 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 GrPendingIOResource<GrSurface, kRead_GrIOType> fSrc; | 213 GrPendingIOResource<GrSurface, kRead_GrIOType> fSrc; |
| 216 }; | 214 }; |
| 217 | 215 |
| 218 struct SetState : public Cmd { | 216 struct SetState : public Cmd { |
| 219 SetState(const GrOptDrawState* state) : Cmd(kSetState_Cmd), fState(SkRef
(state)) {} | 217 SetState(const GrOptDrawState* state) : Cmd(kSetState_Cmd), fState(SkRef
(state)) {} |
| 220 | 218 |
| 221 virtual void execute(GrInOrderDrawBuffer*, const GrOptDrawState*); | 219 virtual void execute(GrInOrderDrawBuffer*, const GrOptDrawState*); |
| 222 | 220 |
| 223 SkAutoTUnref<const GrOptDrawState> fState; | 221 SkAutoTUnref<const GrOptDrawState> fState; |
| 224 GrGpu::DrawType fDrawType; | 222 GrGpu::DrawType fDrawType; |
| 225 GrDeviceCoordTexture fDstCopy; | |
| 226 }; | 223 }; |
| 227 | 224 |
| 228 typedef void* TCmdAlign; // This wouldn't be enough align if a command used
long double. | 225 typedef void* TCmdAlign; // This wouldn't be enough align if a command used
long double. |
| 229 typedef GrTRecorder<Cmd, TCmdAlign> CmdBuffer; | 226 typedef GrTRecorder<Cmd, TCmdAlign> CmdBuffer; |
| 230 | 227 |
| 231 // overrides from GrDrawTarget | 228 // overrides from GrDrawTarget |
| 232 void onDraw(const GrDrawState&, | 229 void onDraw(const GrDrawState&, |
| 233 const DrawInfo&, | 230 const DrawInfo&, |
| 234 const ScissorState&) SK_OVERRIDE; | 231 const ScissorState&, |
| 232 const GrDeviceCoordTexture* dstCopy) SK_OVERRIDE; |
| 235 void onDrawRect(GrDrawState*, | 233 void onDrawRect(GrDrawState*, |
| 236 const SkRect& rect, | 234 const SkRect& rect, |
| 237 const SkRect* localRect, | 235 const SkRect* localRect, |
| 238 const SkMatrix* localMatrix) SK_OVERRIDE; | 236 const SkMatrix* localMatrix) SK_OVERRIDE; |
| 239 | 237 |
| 240 void onStencilPath(const GrDrawState&, | 238 void onStencilPath(const GrDrawState&, |
| 241 const GrPath*, | 239 const GrPath*, |
| 242 const ScissorState&, | 240 const ScissorState&, |
| 243 const GrStencilSettings&) SK_OVERRIDE; | 241 const GrStencilSettings&) SK_OVERRIDE; |
| 244 void onDrawPath(const GrDrawState&, | 242 void onDrawPath(const GrDrawState&, |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 SkTDArray<uint32_t> fPathIndexBuffer; | 318 SkTDArray<uint32_t> fPathIndexBuffer; |
| 321 SkTDArray<float> fPathTransformBuffer; | 319 SkTDArray<float> fPathTransformBuffer; |
| 322 GeoPoolStateStack fGeoPoolStateStack; | 320 GeoPoolStateStack fGeoPoolStateStack; |
| 323 bool fFlushing; | 321 bool fFlushing; |
| 324 uint32_t fDrawID; | 322 uint32_t fDrawID; |
| 325 | 323 |
| 326 typedef GrClipTarget INHERITED; | 324 typedef GrClipTarget INHERITED; |
| 327 }; | 325 }; |
| 328 | 326 |
| 329 #endif | 327 #endif |
| OLD | NEW |