| 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 684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 695 // implemented by subclass to handle release of reserved geom space | 695 // implemented by subclass to handle release of reserved geom space |
| 696 virtual void releaseReservedVertexSpace() = 0; | 696 virtual void releaseReservedVertexSpace() = 0; |
| 697 virtual void releaseReservedIndexSpace() = 0; | 697 virtual void releaseReservedIndexSpace() = 0; |
| 698 // subclass overrides to be notified just before geo src state is pushed/pop
ped. | 698 // subclass overrides to be notified just before geo src state is pushed/pop
ped. |
| 699 virtual void geometrySourceWillPush() = 0; | 699 virtual void geometrySourceWillPush() = 0; |
| 700 virtual void geometrySourceWillPop(const GeometrySrcState& restoredState) =
0; | 700 virtual void geometrySourceWillPop(const GeometrySrcState& restoredState) =
0; |
| 701 // subclass called to perform drawing | 701 // subclass called to perform drawing |
| 702 virtual void onDraw(const GrDrawState&, | 702 virtual void onDraw(const GrDrawState&, |
| 703 const GrGeometryProcessor*, | 703 const GrGeometryProcessor*, |
| 704 const DrawInfo&, | 704 const DrawInfo&, |
| 705 const GrClipMaskManager::ScissorState&, | 705 const GrScissorState&, |
| 706 const GrDeviceCoordTexture* dstCopy) = 0; | 706 const GrDeviceCoordTexture* dstCopy) = 0; |
| 707 // TODO copy in order drawbuffer onDrawRect to here | 707 // TODO copy in order drawbuffer onDrawRect to here |
| 708 virtual void onDrawRect(GrDrawState*, | 708 virtual void onDrawRect(GrDrawState*, |
| 709 GrColor color, | 709 GrColor color, |
| 710 const SkRect& rect, | 710 const SkRect& rect, |
| 711 const SkRect* localRect, | 711 const SkRect* localRect, |
| 712 const SkMatrix* localMatrix) = 0; | 712 const SkMatrix* localMatrix) = 0; |
| 713 | 713 |
| 714 virtual void onStencilPath(const GrDrawState&, | 714 virtual void onStencilPath(const GrDrawState&, |
| 715 const GrPathProcessor*, | 715 const GrPathProcessor*, |
| 716 const GrPath*, | 716 const GrPath*, |
| 717 const GrClipMaskManager::ScissorState&, | 717 const GrScissorState&, |
| 718 const GrStencilSettings&) = 0; | 718 const GrStencilSettings&) = 0; |
| 719 virtual void onDrawPath(const GrDrawState&, | 719 virtual void onDrawPath(const GrDrawState&, |
| 720 const GrPathProcessor*, | 720 const GrPathProcessor*, |
| 721 const GrPath*, | 721 const GrPath*, |
| 722 const GrClipMaskManager::ScissorState&, | 722 const GrScissorState&, |
| 723 const GrStencilSettings&, | 723 const GrStencilSettings&, |
| 724 const GrDeviceCoordTexture* dstCopy) = 0; | 724 const GrDeviceCoordTexture* dstCopy) = 0; |
| 725 virtual void onDrawPaths(const GrDrawState&, | 725 virtual void onDrawPaths(const GrDrawState&, |
| 726 const GrPathProcessor*, | 726 const GrPathProcessor*, |
| 727 const GrPathRange*, | 727 const GrPathRange*, |
| 728 const void* indices, | 728 const void* indices, |
| 729 PathIndexType, | 729 PathIndexType, |
| 730 const float transformValues[], | 730 const float transformValues[], |
| 731 PathTransformType, | 731 PathTransformType, |
| 732 int count, | 732 int count, |
| 733 const GrClipMaskManager::ScissorState&, | 733 const GrScissorState&, |
| 734 const GrStencilSettings&, | 734 const GrStencilSettings&, |
| 735 const GrDeviceCoordTexture*) = 0; | 735 const GrDeviceCoordTexture*) = 0; |
| 736 | 736 |
| 737 virtual void onClear(const SkIRect* rect, GrColor color, bool canIgnoreRect, | 737 virtual void onClear(const SkIRect* rect, GrColor color, bool canIgnoreRect, |
| 738 GrRenderTarget* renderTarget) = 0; | 738 GrRenderTarget* renderTarget) = 0; |
| 739 | 739 |
| 740 /** The subclass will get a chance to copy the surface for falling back to t
he default | 740 /** The subclass will get a chance to copy the surface for falling back to t
he default |
| 741 implementation, which simply draws a rectangle (and fails if dst isn't a
render target). It | 741 implementation, which simply draws a rectangle (and fails if dst isn't a
render target). It |
| 742 should assume that any clipping has already been performed on the rect a
nd point. It won't | 742 should assume that any clipping has already been performed on the rect a
nd point. It won't |
| 743 be called if the copy can be skipped. */ | 743 be called if the copy can be skipped. */ |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 783 // Check to see if this set of draw commands has been sent out | 783 // Check to see if this set of draw commands has been sent out |
| 784 virtual bool isIssued(uint32_t drawID) { return true; } | 784 virtual bool isIssued(uint32_t drawID) { return true; } |
| 785 void getPathStencilSettingsForFilltype(GrPathRendering::FillType, | 785 void getPathStencilSettingsForFilltype(GrPathRendering::FillType, |
| 786 const GrStencilBuffer*, | 786 const GrStencilBuffer*, |
| 787 GrStencilSettings*); | 787 GrStencilSettings*); |
| 788 virtual GrClipMaskManager* clipMaskManager() = 0; | 788 virtual GrClipMaskManager* clipMaskManager() = 0; |
| 789 virtual bool setupClip(const SkRect* devBounds, | 789 virtual bool setupClip(const SkRect* devBounds, |
| 790 GrDrawState::AutoRestoreEffects* are, | 790 GrDrawState::AutoRestoreEffects* are, |
| 791 GrDrawState::AutoRestoreStencil* ars, | 791 GrDrawState::AutoRestoreStencil* ars, |
| 792 GrDrawState*, | 792 GrDrawState*, |
| 793 GrClipMaskManager::ScissorState* scissorState) = 0; | 793 GrScissorState* scissorState) = 0; |
| 794 | 794 |
| 795 enum { | 795 enum { |
| 796 kPreallocGeoSrcStateStackCnt = 4, | 796 kPreallocGeoSrcStateStackCnt = 4, |
| 797 }; | 797 }; |
| 798 SkSTArray<kPreallocGeoSrcStateStackCnt, GeometrySrcState, true> fGeoSrcState
Stack; | 798 SkSTArray<kPreallocGeoSrcStateStackCnt, GeometrySrcState, true> fGeoSrcState
Stack; |
| 799 const GrClipData* fClip; | 799 const GrClipData* fClip; |
| 800 // The context owns us, not vice-versa, so this ptr is not ref'ed by DrawTar
get. | 800 // The context owns us, not vice-versa, so this ptr is not ref'ed by DrawTar
get. |
| 801 GrContext* fContext; | 801 GrContext* fContext; |
| 802 // To keep track that we always have at least as many debug marker adds as r
emoves | 802 // To keep track that we always have at least as many debug marker adds as r
emoves |
| 803 int fGpuTraceMar
kerCount; | 803 int fGpuTraceMar
kerCount; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 843 protected: | 843 protected: |
| 844 GrClipMaskManager fClipMaskManager; | 844 GrClipMaskManager fClipMaskManager; |
| 845 | 845 |
| 846 private: | 846 private: |
| 847 GrClipMaskManager* clipMaskManager() SK_OVERRIDE { return &fClipMaskManager;
} | 847 GrClipMaskManager* clipMaskManager() SK_OVERRIDE { return &fClipMaskManager;
} |
| 848 | 848 |
| 849 virtual bool setupClip(const SkRect* devBounds, | 849 virtual bool setupClip(const SkRect* devBounds, |
| 850 GrDrawState::AutoRestoreEffects* are, | 850 GrDrawState::AutoRestoreEffects* are, |
| 851 GrDrawState::AutoRestoreStencil* ars, | 851 GrDrawState::AutoRestoreStencil* ars, |
| 852 GrDrawState*, | 852 GrDrawState*, |
| 853 GrClipMaskManager::ScissorState* scissorState) SK_OVE
RRIDE; | 853 GrScissorState* scissorState) SK_OVERRIDE; |
| 854 | 854 |
| 855 typedef GrDrawTarget INHERITED; | 855 typedef GrDrawTarget INHERITED; |
| 856 }; | 856 }; |
| 857 | 857 |
| 858 #endif | 858 #endif |
| OLD | NEW |