Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2010 Google Inc. | 3 * Copyright 2010 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 | 9 |
| 10 #ifndef GrDrawTarget_DEFINED | 10 #ifndef GrDrawTarget_DEFINED |
| (...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 614 } | 614 } |
| 615 } | 615 } |
| 616 | 616 |
| 617 ~AutoGeometryAndStatePush() { fTarget->popGeometrySource(); } | 617 ~AutoGeometryAndStatePush() { fTarget->popGeometrySource(); } |
| 618 | 618 |
| 619 private: | 619 private: |
| 620 AutoStateRestore fState; | 620 AutoStateRestore fState; |
| 621 GrDrawTarget* fTarget; | 621 GrDrawTarget* fTarget; |
| 622 }; | 622 }; |
| 623 | 623 |
| 624 /////////////////////////////////////////////////////////////////////////// | |
| 625 // Flush tracking (for font atlases and other resources) | |
| 626 class FlushToken { | |
| 627 public: | |
| 628 FlushToken(GrDrawTarget* drawTarget, uint32_t flushID) : | |
| 629 fDrawTarget(drawTarget), fFlushID(flushID) {} | |
| 630 | |
| 631 bool isCurrent() { return NULL != fDrawTarget && fDrawTarget->isCurrentF lush(fFlushID); } | |
|
bsalomon
2013/08/14 19:04:27
I think we should reverse the sense of this: isFlu
jvanverth1
2013/08/15 14:49:58
Done.
| |
| 632 | |
| 633 private: | |
| 634 GrDrawTarget* fDrawTarget; | |
| 635 uint32_t fFlushID; // this may wrap, but we're doing direct comp arison | |
| 636 // so that should be okay | |
| 637 }; | |
| 638 | |
| 639 virtual FlushToken getCurrentFlushToken() { return FlushToken(this, 0); } | |
| 640 virtual bool isCurrentFlush(uint32_t) { return false; } | |
| 641 | |
| 624 protected: | 642 protected: |
| 625 | 643 |
| 626 enum GeometrySrcType { | 644 enum GeometrySrcType { |
| 627 kNone_GeometrySrcType, //<! src has not been specified | 645 kNone_GeometrySrcType, //<! src has not been specified |
| 628 kReserved_GeometrySrcType, //<! src was set using reserve*Space | 646 kReserved_GeometrySrcType, //<! src was set using reserve*Space |
| 629 kArray_GeometrySrcType, //<! src was set using set*SourceToArray | 647 kArray_GeometrySrcType, //<! src was set using set*SourceToArray |
| 630 kBuffer_GeometrySrcType //<! src was set using set*SourceToBuffer | 648 kBuffer_GeometrySrcType //<! src was set using set*SourceToBuffer |
| 631 }; | 649 }; |
| 632 | 650 |
| 633 struct GeometrySrcState { | 651 struct GeometrySrcState { |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 846 const GrClipData* fClip; | 864 const GrClipData* fClip; |
| 847 GrDrawState* fDrawState; | 865 GrDrawState* fDrawState; |
| 848 GrDrawState fDefaultDraw State; | 866 GrDrawState fDefaultDraw State; |
| 849 // The context owns us, not vice-versa, so this ptr is not ref'ed by DrawTar get. | 867 // The context owns us, not vice-versa, so this ptr is not ref'ed by DrawTar get. |
| 850 GrContext* fContext; | 868 GrContext* fContext; |
| 851 | 869 |
| 852 typedef GrRefCnt INHERITED; | 870 typedef GrRefCnt INHERITED; |
| 853 }; | 871 }; |
| 854 | 872 |
| 855 #endif | 873 #endif |
| OLD | NEW |