Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(30)

Side by Side Diff: src/gpu/GrInOrderDrawBuffer.cpp

Issue 13468004: Make drawRect preserve vertex attrib state and push/pop the geom sources. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« src/gpu/GrDrawTarget.h ('K') | « src/gpu/GrInOrderDrawBuffer.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« src/gpu/GrDrawTarget.h ('K') | « src/gpu/GrInOrderDrawBuffer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698