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 19 matching lines...) Expand all Loading... |
30 class GrPathRange; | 30 class GrPathRange; |
31 class GrVertexBuffer; | 31 class GrVertexBuffer; |
32 | 32 |
33 class GrDrawTarget : public SkRefCnt { | 33 class GrDrawTarget : public SkRefCnt { |
34 protected: | 34 protected: |
35 class DrawInfo; | 35 class DrawInfo; |
36 | 36 |
37 public: | 37 public: |
38 SK_DECLARE_INST_COUNT(GrDrawTarget) | 38 SK_DECLARE_INST_COUNT(GrDrawTarget) |
39 | 39 |
40 | |
41 typedef GrPathRendering::PathTransformType PathTransformType ; | 40 typedef GrPathRendering::PathTransformType PathTransformType ; |
42 | 41 |
43 /////////////////////////////////////////////////////////////////////////// | 42 /////////////////////////////////////////////////////////////////////////// |
44 | 43 |
45 // The context may not be fully constructed and should not be used during Gr
DrawTarget | 44 // The context may not be fully constructed and should not be used during Gr
DrawTarget |
46 // construction. | 45 // construction. |
47 GrDrawTarget(GrContext* context); | 46 GrDrawTarget(GrContext* context); |
48 virtual ~GrDrawTarget(); | 47 virtual ~GrDrawTarget(); |
49 | 48 |
50 /** | 49 /** |
(...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
686 bool isIssued() { return fDrawTarget && fDrawTarget->isIssued(fDrawID);
} | 685 bool isIssued() { return fDrawTarget && fDrawTarget->isIssued(fDrawID);
} |
687 | 686 |
688 private: | 687 private: |
689 GrDrawTarget* fDrawTarget; | 688 GrDrawTarget* fDrawTarget; |
690 uint32_t fDrawID; // this may wrap, but we're doing direct compa
rison | 689 uint32_t fDrawID; // this may wrap, but we're doing direct compa
rison |
691 // so that should be okay | 690 // so that should be okay |
692 }; | 691 }; |
693 | 692 |
694 virtual DrawToken getCurrentDrawToken() { return DrawToken(this, 0); } | 693 virtual DrawToken getCurrentDrawToken() { return DrawToken(this, 0); } |
695 | 694 |
| 695 // The state of the scissor is controlled by the clip manager, no one else s
hould set |
| 696 // Scissor state |
| 697 struct ScissorState { |
| 698 ScissorState() : fEnabled(false) {} |
| 699 void set(const SkIRect& rect) { fRect = rect; fEnabled = true; } |
| 700 bool fEnabled; |
| 701 SkIRect fRect; |
| 702 }; |
| 703 |
696 protected: | 704 protected: |
697 // Extend access to GrDrawState::convertToPEndeingExec to subclasses. | 705 // Extend access to GrDrawState::convertToPEndeingExec to subclasses. |
698 void convertDrawStateToPendingExec(GrDrawState* ds) { | 706 void convertDrawStateToPendingExec(GrDrawState* ds) { |
699 ds->convertToPendingExec(); | 707 ds->convertToPendingExec(); |
700 } | 708 } |
701 | 709 |
702 enum GeometrySrcType { | 710 enum GeometrySrcType { |
703 kNone_GeometrySrcType, //<! src has not been specified | 711 kNone_GeometrySrcType, //<! src has not been specified |
704 kReserved_GeometrySrcType, //<! src was set using reserve*Space | 712 kReserved_GeometrySrcType, //<! src was set using reserve*Space |
705 kArray_GeometrySrcType, //<! src was set using set*SourceToArray | 713 kArray_GeometrySrcType, //<! src was set using set*SourceToArray |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
935 GrContext* fContext; | 943 GrContext* fContext; |
936 // To keep track that we always have at least as many debug marker adds as r
emoves | 944 // To keep track that we always have at least as many debug marker adds as r
emoves |
937 int fGpuTraceMar
kerCount; | 945 int fGpuTraceMar
kerCount; |
938 GrTraceMarkerSet fActiveTrace
Markers; | 946 GrTraceMarkerSet fActiveTrace
Markers; |
939 GrTraceMarkerSet fStoredTrace
Markers; | 947 GrTraceMarkerSet fStoredTrace
Markers; |
940 | 948 |
941 typedef SkRefCnt INHERITED; | 949 typedef SkRefCnt INHERITED; |
942 }; | 950 }; |
943 | 951 |
944 #endif | 952 #endif |
OLD | NEW |