| 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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 const SkIRect& srcRect, | 170 const SkIRect& srcRect, |
| 171 const SkIPoint& dstPoint); | 171 const SkIPoint& dstPoint); |
| 172 /** | 172 /** |
| 173 * Release any resources that are cached but not currently in use. This | 173 * Release any resources that are cached but not currently in use. This |
| 174 * is intended to give an application some recourse when resources are low. | 174 * is intended to give an application some recourse when resources are low. |
| 175 */ | 175 */ |
| 176 virtual void purgeResources() {}; | 176 virtual void purgeResources() {}; |
| 177 | 177 |
| 178 bool programUnitTest(GrContext* owner, int maxStages); | 178 bool programUnitTest(GrContext* owner, int maxStages); |
| 179 | 179 |
| 180 struct PipelineInfo { | |
| 181 PipelineInfo(const GrPipelineBuilder* pipelineBuilder, const GrScissorSt
ate* scissor, | |
| 182 const GrDrawBatch* batch, const SkRect* devBounds, | |
| 183 GrDrawTarget* target); | |
| 184 | |
| 185 bool valid() const { return SkToBool(fArgs.fPipelineBuilder); } | |
| 186 | |
| 187 const GrPipeline::CreateArgs& pipelineCreateArgs() const { | |
| 188 SkASSERT(this->valid()); | |
| 189 return fArgs; | |
| 190 } | |
| 191 | |
| 192 private: | |
| 193 GrPipeline::CreateArgs fArgs; | |
| 194 }; | |
| 195 | |
| 196 protected: | 180 protected: |
| 197 GrGpu* getGpu() { return fGpu; } | 181 GrGpu* getGpu() { return fGpu; } |
| 198 const GrGpu* getGpu() const { return fGpu; } | 182 const GrGpu* getGpu() const { return fGpu; } |
| 199 | 183 |
| 200 // Makes a copy of the dst if it is necessary for the draw. Returns false if
a copy is required | |
| 201 // but couldn't be made. Otherwise, returns true. This method needs to be p
rotected because it | |
| 202 // needs to be accessed by GLPrograms to setup a correct drawstate | |
| 203 bool setupDstReadIfNecessary(const GrPipelineBuilder&, | |
| 204 const GrProcOptInfo& colorPOI, | |
| 205 const GrProcOptInfo& coveragePOI, | |
| 206 GrXferProcessor::DstTexture*, | |
| 207 const SkRect* drawBounds); | |
| 208 | |
| 209 void recordBatch(GrBatch*); | 184 void recordBatch(GrBatch*); |
| 210 | 185 |
| 211 private: | 186 private: |
| 212 SkSTArray<256, SkAutoTUnref<GrBatch>, true> fBatches; | 187 SkSTArray<256, SkAutoTUnref<GrBatch>, true> fBatches; |
| 213 | 188 |
| 189 bool installPipelineInDrawBatch(const GrPipelineBuilder* pipelineBuilder, |
| 190 const GrScissorState* scissor, |
| 191 GrDrawBatch* batch); |
| 192 |
| 193 // Makes a copy of the dst if it is necessary for the draw. Returns false if
a copy is required |
| 194 // but couldn't be made. Otherwise, returns true. This method needs to be p
rotected because it |
| 195 // needs to be accessed by GLPrograms to setup a correct drawstate |
| 196 bool setupDstReadIfNecessary(const GrPipelineBuilder&, |
| 197 const GrProcOptInfo& colorPOI, |
| 198 const GrProcOptInfo& coveragePOI, |
| 199 GrXferProcessor::DstTexture*, |
| 200 const SkRect& batchBounds); |
| 201 |
| 214 void drawPathBatch(const GrPipelineBuilder& pipelineBuilder, GrDrawPathBatch
Base* batch, | 202 void drawPathBatch(const GrPipelineBuilder& pipelineBuilder, GrDrawPathBatch
Base* batch, |
| 215 GrPathRendering::FillType fill); | 203 GrPathRendering::FillType fill); |
| 216 // Check to see if this set of draw commands has been sent out | 204 // Check to see if this set of draw commands has been sent out |
| 217 void getPathStencilSettingsForFilltype(GrPathRendering::FillType, | 205 void getPathStencilSettingsForFilltype(GrPathRendering::FillType, |
| 218 const GrStencilAttachment*, | 206 const GrStencilAttachment*, |
| 219 GrStencilSettings*); | 207 GrStencilSettings*); |
| 220 virtual GrClipMaskManager* clipMaskManager() = 0; | 208 virtual GrClipMaskManager* clipMaskManager() = 0; |
| 221 virtual bool setupClip(const GrPipelineBuilder&, | 209 virtual bool setupClip(const GrPipelineBuilder&, |
| 222 GrPipelineBuilder::AutoRestoreFragmentProcessorState*
, | 210 GrPipelineBuilder::AutoRestoreFragmentProcessorState*
, |
| 223 GrPipelineBuilder::AutoRestoreStencil*, | 211 GrPipelineBuilder::AutoRestoreStencil*, |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 bool setupClip(const GrPipelineBuilder&, | 258 bool setupClip(const GrPipelineBuilder&, |
| 271 GrPipelineBuilder::AutoRestoreFragmentProcessorState*, | 259 GrPipelineBuilder::AutoRestoreFragmentProcessorState*, |
| 272 GrPipelineBuilder::AutoRestoreStencil*, | 260 GrPipelineBuilder::AutoRestoreStencil*, |
| 273 GrScissorState* scissorState, | 261 GrScissorState* scissorState, |
| 274 const SkRect* devBounds) override; | 262 const SkRect* devBounds) override; |
| 275 | 263 |
| 276 typedef GrDrawTarget INHERITED; | 264 typedef GrDrawTarget INHERITED; |
| 277 }; | 265 }; |
| 278 | 266 |
| 279 #endif | 267 #endif |
| OLD | NEW |