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 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
498 /** | 498 /** |
499 * For subclass internal use to invoke a call to onDrawPaths(). | 499 * For subclass internal use to invoke a call to onDrawPaths(). |
500 */ | 500 */ |
501 void executeDrawPaths(const GrPathRange* pathRange, | 501 void executeDrawPaths(const GrPathRange* pathRange, |
502 const uint32_t indices[], int count, | 502 const uint32_t indices[], int count, |
503 const float transforms[], PathTransformType transforms Type, | 503 const float transforms[], PathTransformType transforms Type, |
504 SkPath::FillType fill, | 504 SkPath::FillType fill, |
505 const GrDeviceCoordTexture* dstCopy) { | 505 const GrDeviceCoordTexture* dstCopy) { |
506 this->onDrawPaths(pathRange, indices, count, transforms, transformsType, fill, dstCopy); | 506 this->onDrawPaths(pathRange, indices, count, transforms, transformsType, fill, dstCopy); |
507 } | 507 } |
508 | |
508 //////////////////////////////////////////////////////////////////////////// | 509 //////////////////////////////////////////////////////////////////////////// |
509 | 510 |
510 /** | 511 /** |
511 * See AutoStateRestore below. | 512 * See AutoStateRestore below. |
512 */ | 513 */ |
513 enum ASRInit { | 514 enum ASRInit { |
514 kPreserve_ASRInit, | 515 kPreserve_ASRInit, |
515 kReset_ASRInit | 516 kReset_ASRInit |
516 }; | 517 }; |
517 | 518 |
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
934 // The context owns us, not vice-versa, so this ptr is not ref'ed by DrawTar get. | 935 // The context owns us, not vice-versa, so this ptr is not ref'ed by DrawTar get. |
935 GrContext* fContext; | 936 GrContext* fContext; |
936 // To keep track that we always have at least as many debug marker adds as r emoves | 937 // To keep track that we always have at least as many debug marker adds as r emoves |
937 int fGpuTraceMar kerCount; | 938 int fGpuTraceMar kerCount; |
938 GrTraceMarkerSet fActiveTrace Markers; | 939 GrTraceMarkerSet fActiveTrace Markers; |
939 GrTraceMarkerSet fStoredTrace Markers; | 940 GrTraceMarkerSet fStoredTrace Markers; |
940 | 941 |
941 typedef SkRefCnt INHERITED; | 942 typedef SkRefCnt INHERITED; |
942 }; | 943 }; |
943 | 944 |
944 class GrClipTarget : public GrDrawTarget { | 945 class GrClipTarget : public GrDrawTarget { |
bsalomon
2014/10/28 17:53:28
This class needs a comment about why it exists.
| |
945 public: | 946 public: |
946 GrClipTarget(GrContext* context) : INHERITED(context) {} | 947 GrClipTarget(GrContext* context) : INHERITED(context) { |
948 fClipMaskManager.setClipTarget(this); | |
949 } | |
950 | |
951 void getPathStencilSettingsForFillType(SkPath::FillType, GrStencilSettings*) ; | |
952 | |
953 /* Clip mask manager needs access to the context. | |
954 * TODO we only need a very small subset of context in the CMM. | |
955 */ | |
956 GrContext* getContext() { return INHERITED::getContext(); } | |
957 const GrContext* getContext() const { return INHERITED::getContext(); } | |
958 | |
947 /** | 959 /** |
948 * Clip Mask Manager(and no one else) needs to clear private stencil bits. | 960 * Clip Mask Manager(and no one else) needs to clear private stencil bits. |
949 * ClipTarget subclass sets clip bit in the stencil buffer. The subclass | 961 * ClipTarget subclass sets clip bit in the stencil buffer. The subclass |
950 * is free to clear the remaining bits to zero if masked clears are more | 962 * is free to clear the remaining bits to zero if masked clears are more |
951 * expensive than clearing all bits. | 963 * expensive than clearing all bits. |
952 */ | 964 */ |
953 virtual void clearStencilClip(const SkIRect& rect, bool insideClip, GrRender Target* = NULL) = 0; | 965 virtual void clearStencilClip(const SkIRect& rect, bool insideClip, GrRender Target* = NULL) = 0; |
954 | 966 |
967 protected: | |
968 GrClipMaskManager fClipMaskManager; | |
969 | |
955 private: | 970 private: |
956 typedef GrDrawTarget INHERITED; | 971 typedef GrDrawTarget INHERITED; |
957 }; | 972 }; |
958 | 973 |
959 #endif | 974 #endif |
OLD | NEW |