| 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 867 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 878 const float transforms[], | 878 const float transforms[], |
| 879 PathTransformType, | 879 PathTransformType, |
| 880 const GrClipMaskManager::ScissorState&, | 880 const GrClipMaskManager::ScissorState&, |
| 881 const GrStencilSettings&, | 881 const GrStencilSettings&, |
| 882 const GrDeviceCoordTexture*) = 0; | 882 const GrDeviceCoordTexture*) = 0; |
| 883 | 883 |
| 884 virtual void onClear(const SkIRect* rect, GrColor color, bool canIgnoreRect, | 884 virtual void onClear(const SkIRect* rect, GrColor color, bool canIgnoreRect, |
| 885 GrRenderTarget* renderTarget) = 0; | 885 GrRenderTarget* renderTarget) = 0; |
| 886 | 886 |
| 887 | 887 |
| 888 virtual void didAddGpuTraceMarker() = 0; | |
| 889 virtual void didRemoveGpuTraceMarker() = 0; | |
| 890 | |
| 891 // helpers for reserving vertex and index space. | 888 // helpers for reserving vertex and index space. |
| 892 bool reserveVertexSpace(size_t vertexSize, | 889 bool reserveVertexSpace(size_t vertexSize, |
| 893 int vertexCount, | 890 int vertexCount, |
| 894 void** vertices); | 891 void** vertices); |
| 895 bool reserveIndexSpace(int indexCount, void** indices); | 892 bool reserveIndexSpace(int indexCount, void** indices); |
| 896 | 893 |
| 897 // called by drawIndexed and drawNonIndexed. Use a negative indexCount to | 894 // called by drawIndexed and drawNonIndexed. Use a negative indexCount to |
| 898 // indicate non-indexed drawing. | 895 // indicate non-indexed drawing. |
| 899 bool checkDraw(GrPrimitiveType type, int startVertex, | 896 bool checkDraw(GrPrimitiveType type, int startVertex, |
| 900 int startIndex, int vertexCount, | 897 int startIndex, int vertexCount, |
| (...skipping 18 matching lines...) Expand all Loading... |
| 919 const GrClipData* fClip; | 916 const GrClipData* fClip; |
| 920 GrDrawState* fDrawState; | 917 GrDrawState* fDrawState; |
| 921 GrDrawState fDefaultDraw
State; | 918 GrDrawState fDefaultDraw
State; |
| 922 // The context owns us, not vice-versa, so this ptr is not ref'ed by DrawTar
get. | 919 // The context owns us, not vice-versa, so this ptr is not ref'ed by DrawTar
get. |
| 923 GrContext* fContext; | 920 GrContext* fContext; |
| 924 // To keep track that we always have at least as many debug marker adds as r
emoves | 921 // To keep track that we always have at least as many debug marker adds as r
emoves |
| 925 int fGpuTraceMar
kerCount; | 922 int fGpuTraceMar
kerCount; |
| 926 GrTraceMarkerSet fActiveTrace
Markers; | 923 GrTraceMarkerSet fActiveTrace
Markers; |
| 927 GrTraceMarkerSet fStoredTrace
Markers; | 924 GrTraceMarkerSet fStoredTrace
Markers; |
| 928 | 925 |
| 929 // TODO fix this | |
| 930 friend class GrGpu; | |
| 931 friend class GrGpuGL; | |
| 932 | |
| 933 typedef SkRefCnt INHERITED; | 926 typedef SkRefCnt INHERITED; |
| 934 }; | 927 }; |
| 935 | 928 |
| 936 /* | 929 /* |
| 937 * This class is JUST for clip mask manager. Everyone else should just use draw
target above. | 930 * This class is JUST for clip mask manager. Everyone else should just use draw
target above. |
| 938 */ | 931 */ |
| 939 class GrClipTarget : public GrDrawTarget { | 932 class GrClipTarget : public GrDrawTarget { |
| 940 public: | 933 public: |
| 941 GrClipTarget(GrContext* context) : INHERITED(context) { | 934 GrClipTarget(GrContext* context) : INHERITED(context) { |
| 942 fClipMaskManager.setClipTarget(this); | 935 fClipMaskManager.setClipTarget(this); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 974 | 967 |
| 975 virtual bool setupClip(const SkRect* devBounds, | 968 virtual bool setupClip(const SkRect* devBounds, |
| 976 GrDrawState::AutoRestoreEffects* are, | 969 GrDrawState::AutoRestoreEffects* are, |
| 977 GrDrawState::AutoRestoreStencil* ars, | 970 GrDrawState::AutoRestoreStencil* ars, |
| 978 GrClipMaskManager::ScissorState* scissorState) SK_OVE
RRIDE; | 971 GrClipMaskManager::ScissorState* scissorState) SK_OVE
RRIDE; |
| 979 | 972 |
| 980 typedef GrDrawTarget INHERITED; | 973 typedef GrDrawTarget INHERITED; |
| 981 }; | 974 }; |
| 982 | 975 |
| 983 #endif | 976 #endif |
| OLD | NEW |