OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 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 #include "GrInOrderDrawBuffer.h" | 10 #include "GrInOrderDrawBuffer.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 const GrPoint* point = static_cast<const GrPoint*>(vertices); | 66 const GrPoint* point = static_cast<const GrPoint*>(vertices); |
67 bounds->fLeft = bounds->fRight = point->fX; | 67 bounds->fLeft = bounds->fRight = point->fX; |
68 bounds->fTop = bounds->fBottom = point->fY; | 68 bounds->fTop = bounds->fBottom = point->fY; |
69 for (int i = 1; i < vertexCount; ++i) { | 69 for (int i = 1; i < vertexCount; ++i) { |
70 point = reinterpret_cast<GrPoint*>(reinterpret_cast<intptr_t>(point) + v
ertexSize); | 70 point = reinterpret_cast<GrPoint*>(reinterpret_cast<intptr_t>(point) + v
ertexSize); |
71 bounds->growToInclude(point->fX, point->fY); | 71 bounds->growToInclude(point->fX, point->fY); |
72 } | 72 } |
73 } | 73 } |
74 } | 74 } |
75 | 75 |
76 void GrInOrderDrawBuffer::drawRect(const GrRect& rect, | 76 void GrInOrderDrawBuffer::onDrawRect(const GrRect& rect, |
77 const SkMatrix* matrix, | 77 const SkMatrix* matrix, |
78 const GrRect* localRect, | 78 const GrRect* localRect, |
79 const SkMatrix* localMatrix) { | 79 const SkMatrix* localMatrix) { |
80 GrDrawState::AutoColorRestore acr; | 80 GrDrawState::AutoColorRestore acr; |
81 | 81 |
82 GrDrawState* drawState = this->drawState(); | 82 GrDrawState* drawState = this->drawState(); |
83 | 83 |
84 GrColor color = drawState->getColor(); | 84 GrColor color = drawState->getColor(); |
85 GrVertexAttribArray<3> attribs; | 85 GrVertexAttribArray<3> attribs; |
86 | 86 |
87 // set position attrib | 87 // set position attrib |
88 static const GrVertexAttrib kPosAttrib = | 88 static const GrVertexAttrib kPosAttrib = |
89 {kVec2f_GrVertexAttribType, 0, kPosition_GrVertexAttribBinding}; | 89 {kVec2f_GrVertexAttribType, 0, kPosition_GrVertexAttribBinding}; |
(...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
754 GrInOrderDrawBuffer::Clear* GrInOrderDrawBuffer::recordClear() { | 754 GrInOrderDrawBuffer::Clear* GrInOrderDrawBuffer::recordClear() { |
755 fCmds.push_back(kClear_Cmd); | 755 fCmds.push_back(kClear_Cmd); |
756 return &fClears.push_back(); | 756 return &fClears.push_back(); |
757 } | 757 } |
758 | 758 |
759 void GrInOrderDrawBuffer::clipWillBeSet(const GrClipData* newClipData) { | 759 void GrInOrderDrawBuffer::clipWillBeSet(const GrClipData* newClipData) { |
760 INHERITED::clipWillBeSet(newClipData); | 760 INHERITED::clipWillBeSet(newClipData); |
761 fClipSet = true; | 761 fClipSet = true; |
762 fClipProxyState = kUnknown_ClipProxyState; | 762 fClipProxyState = kUnknown_ClipProxyState; |
763 } | 763 } |
OLD | NEW |