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 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
523 | 523 |
524 /////////////////////////////////////////////////////////////////////////// | 524 /////////////////////////////////////////////////////////////////////////// |
525 /// @name Render Target | 525 /// @name Render Target |
526 //// | 526 //// |
527 | 527 |
528 /** | 528 /** |
529 * Retrieves the currently set render-target. | 529 * Retrieves the currently set render-target. |
530 * | 530 * |
531 * @return The currently set render target. | 531 * @return The currently set render target. |
532 */ | 532 */ |
533 GrRenderTarget* getRenderTarget() const { | 533 GrRenderTarget* getRenderTarget() const { return fRenderTarget.get(); } |
534 return static_cast<GrRenderTarget*>(fRenderTarget.getResource()); | |
535 } | |
536 | 534 |
537 /** | 535 /** |
538 * Sets the render-target used at the next drawing call | 536 * Sets the render-target used at the next drawing call |
539 * | 537 * |
540 * @param target The render target to set. | 538 * @param target The render target to set. |
541 */ | 539 */ |
542 void setRenderTarget(GrRenderTarget* target) { | 540 void setRenderTarget(GrRenderTarget* target) { |
543 fRenderTarget.set(SkSafeRef(target), kWrite_GrIOType); | 541 fRenderTarget.set(SkSafeRef(target), kWrite_GrIOType); |
544 this->invalidateOptState(); | 542 this->invalidateOptState(); |
545 } | 543 } |
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
853 mutable uint32_t fCachedCapsID; | 851 mutable uint32_t fCachedCapsID; |
854 | 852 |
855 friend class GrOptDrawState; | 853 friend class GrOptDrawState; |
856 | 854 |
857 typedef SkRefCnt INHERITED; | 855 typedef SkRefCnt INHERITED; |
858 }; | 856 }; |
859 | 857 |
860 GR_MAKE_BITFIELD_OPS(GrDrawState::BlendOptFlags); | 858 GR_MAKE_BITFIELD_OPS(GrDrawState::BlendOptFlags); |
861 | 859 |
862 #endif | 860 #endif |
OLD | NEW |