OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 GrDrawState_DEFINED | 8 #ifndef GrDrawState_DEFINED |
9 #define GrDrawState_DEFINED | 9 #define GrDrawState_DEFINED |
10 | 10 |
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
540 const GrDrawTargetCaps& caps); | 540 const GrDrawTargetCaps& caps); |
541 | 541 |
542 GrDrawState& operator= (const GrDrawState& that); | 542 GrDrawState& operator= (const GrDrawState& that); |
543 | 543 |
544 /** | 544 /** |
545 * Returns a snapshot of the current optimized state. If the current drawSta
te has a valid | 545 * Returns a snapshot of the current optimized state. If the current drawSta
te has a valid |
546 * cached optimiezed state it will simply return a pointer to it otherwise i
t will create a new | 546 * cached optimiezed state it will simply return a pointer to it otherwise i
t will create a new |
547 * GrOptDrawState. In all cases the GrOptDrawState is reffed and ownership i
s given to the | 547 * GrOptDrawState. In all cases the GrOptDrawState is reffed and ownership i
s given to the |
548 * caller. | 548 * caller. |
549 */ | 549 */ |
550 GrOptDrawState* createOptState() const; | 550 GrOptDrawState* createOptState(const GrDrawTargetCaps&) const; |
551 | 551 |
552 private: | 552 private: |
553 void invalidateOptState() const; | 553 void invalidateOptState() const; |
554 | 554 |
555 void onReset(const SkMatrix* initialViewMatrix); | 555 void onReset(const SkMatrix* initialViewMatrix); |
556 | 556 |
557 // Some of the auto restore objects assume that no effects are removed durin
g their lifetime. | 557 // Some of the auto restore objects assume that no effects are removed durin
g their lifetime. |
558 // This is used to assert that this condition holds. | 558 // This is used to assert that this condition holds. |
559 SkDEBUGCODE(int fBlockEffectRemovalCnt;) | 559 SkDEBUGCODE(int fBlockEffectRemovalCnt;) |
560 | 560 |
561 void internalSetVertexAttribs(const GrVertexAttrib attribs[], int count, siz
e_t stride); | 561 void internalSetVertexAttribs(const GrVertexAttrib attribs[], int count, siz
e_t stride); |
562 | 562 |
563 mutable GrOptDrawState* fCachedOptState; | 563 mutable GrOptDrawState* fCachedOptState; |
564 | 564 |
565 typedef GrRODrawState INHERITED; | 565 typedef GrRODrawState INHERITED; |
566 }; | 566 }; |
567 | 567 |
568 #endif | 568 #endif |
OLD | NEW |