OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2010 Google Inc. | 2 * Copyright 2010 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 GrDrawTarget_DEFINED | 8 #ifndef GrDrawTarget_DEFINED |
9 #define GrDrawTarget_DEFINED | 9 #define GrDrawTarget_DEFINED |
10 | 10 |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 const GrSurface* src, | 195 const GrSurface* src, |
196 const SkIRect& srcRect, | 196 const SkIRect& srcRect, |
197 const SkIPoint& dstPoint); | 197 const SkIPoint& dstPoint); |
198 | 198 |
199 /** | 199 /** |
200 * Release any resources that are cached but not currently in use. This | 200 * Release any resources that are cached but not currently in use. This |
201 * is intended to give an application some recourse when resources are low. | 201 * is intended to give an application some recourse when resources are low. |
202 */ | 202 */ |
203 virtual void purgeResources() {}; | 203 virtual void purgeResources() {}; |
204 | 204 |
205 /////////////////////////////////////////////////////////////////////////// | |
206 // Draw execution tracking (for font atlases and other resources) | |
207 class DrawToken { | |
208 public: | |
209 DrawToken(GrDrawTarget* drawTarget, uint32_t drawID) : | |
210 fDrawTarget(drawTarget), fDrawID(drawID) {} | |
211 | |
212 bool isIssued() { return fDrawTarget && fDrawTarget->isIssued(fDrawID);
} | |
213 | |
214 private: | |
215 GrDrawTarget* fDrawTarget; | |
216 uint32_t fDrawID; // this may wrap, but we're doing direct compa
rison | |
217 // so that should be okay | |
218 }; | |
219 | |
220 virtual DrawToken getCurrentDrawToken() { return DrawToken(this, 0); } | |
221 | |
222 bool programUnitTest(int maxStages); | 205 bool programUnitTest(int maxStages); |
223 | 206 |
224 protected: | 207 protected: |
225 friend class GrCommandBuilder; // for PipelineInfo | 208 friend class GrCommandBuilder; // for PipelineInfo |
226 friend class GrInOrderCommandBuilder; // for PipelineInfo | 209 friend class GrInOrderCommandBuilder; // for PipelineInfo |
227 friend class GrReorderCommandBuilder; // for PipelineInfo | 210 friend class GrReorderCommandBuilder; // for PipelineInfo |
228 friend class GrTargetCommands; // for PipelineInfo | 211 friend class GrTargetCommands; // for PipelineInfo |
229 | 212 |
230 GrContext* getContext() { return fContext; } | 213 GrContext* getContext() { return fContext; } |
231 const GrContext* getContext() const { return fContext; } | 214 const GrContext* getContext() const { return fContext; } |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 virtual bool setupClip(GrPipelineBuilder*, | 361 virtual bool setupClip(GrPipelineBuilder*, |
379 GrPipelineBuilder::AutoRestoreFragmentProcessors*, | 362 GrPipelineBuilder::AutoRestoreFragmentProcessors*, |
380 GrPipelineBuilder::AutoRestoreStencil*, | 363 GrPipelineBuilder::AutoRestoreStencil*, |
381 GrScissorState* scissorState, | 364 GrScissorState* scissorState, |
382 const SkRect* devBounds) override; | 365 const SkRect* devBounds) override; |
383 | 366 |
384 typedef GrDrawTarget INHERITED; | 367 typedef GrDrawTarget INHERITED; |
385 }; | 368 }; |
386 | 369 |
387 #endif | 370 #endif |
OLD | NEW |