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 670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
681 | 681 |
682 int indexCountInCurrentSource() const { | 682 int indexCountInCurrentSource() const { |
683 const GeometrySrcState& src = this->getGeomSrc(); | 683 const GeometrySrcState& src = this->getGeomSrc(); |
684 switch (src.fIndexSrc) { | 684 switch (src.fIndexSrc) { |
685 case kNone_GeometrySrcType: | 685 case kNone_GeometrySrcType: |
686 return 0; | 686 return 0; |
687 case kReserved_GeometrySrcType: | 687 case kReserved_GeometrySrcType: |
688 case kArray_GeometrySrcType: | 688 case kArray_GeometrySrcType: |
689 return src.fIndexCount; | 689 return src.fIndexCount; |
690 case kBuffer_GeometrySrcType: | 690 case kBuffer_GeometrySrcType: |
691 return src.fIndexBuffer->sizeInBytes() / sizeof(uint16_t); | 691 return static_cast<int>(src.fIndexBuffer->sizeInBytes() / sizeof
(uint16_t)); |
692 default: | 692 default: |
693 GrCrash("Unexpected Index Source."); | 693 GrCrash("Unexpected Index Source."); |
694 return 0; | 694 return 0; |
695 } | 695 } |
696 } | 696 } |
697 | 697 |
698 // This method is called by copySurface The srcRect is guaranteed to be ent
irely within the | 698 // This method is called by copySurface The srcRect is guaranteed to be ent
irely within the |
699 // src bounds. Likewise, the dst rect implied by dstPoint and srcRect's widt
h and height falls | 699 // src bounds. Likewise, the dst rect implied by dstPoint and srcRect's widt
h and height falls |
700 // entirely within the dst. The default implementation will draw a rect from
the src to the | 700 // entirely within the dst. The default implementation will draw a rect from
the src to the |
701 // dst if the src is a texture and the dst is a render target and fail other
wise. | 701 // dst if the src is a texture and the dst is a render target and fail other
wise. |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
875 const GrClipData* fClip; | 875 const GrClipData* fClip; |
876 GrDrawState* fDrawState; | 876 GrDrawState* fDrawState; |
877 GrDrawState fDefaultDraw
State; | 877 GrDrawState fDefaultDraw
State; |
878 // The context owns us, not vice-versa, so this ptr is not ref'ed by DrawTar
get. | 878 // The context owns us, not vice-versa, so this ptr is not ref'ed by DrawTar
get. |
879 GrContext* fContext; | 879 GrContext* fContext; |
880 | 880 |
881 typedef SkRefCnt INHERITED; | 881 typedef SkRefCnt INHERITED; |
882 }; | 882 }; |
883 | 883 |
884 #endif | 884 #endif |
OLD | NEW |