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

Unified Diff: src/gpu/GrInOrderDrawBuffer.cpp

Issue 364823004: Combine clip stack and clip origin into one struct in GrIODB. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrInOrderDrawBuffer.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrInOrderDrawBuffer.cpp
diff --git a/src/gpu/GrInOrderDrawBuffer.cpp b/src/gpu/GrInOrderDrawBuffer.cpp
index 45c38848288233c0efac7210e2af550c315db808..1cd7f539de3076d9d29599316f9fd75d9b80975b 100644
--- a/src/gpu/GrInOrderDrawBuffer.cpp
+++ b/src/gpu/GrInOrderDrawBuffer.cpp
@@ -548,7 +548,6 @@ void GrInOrderDrawBuffer::reset() {
fVertexPool.reset();
fIndexPool.reset();
fClips.reset();
- fClipOrigins.reset();
fCopySurfaces.reset();
fGpuCmdMarkers.reset();
fClipSet = true;
@@ -587,7 +586,6 @@ void GrInOrderDrawBuffer::flush() {
StateAllocator::Iter stateIter(&fStates);
ClipAllocator::Iter clipIter(&fClips);
- ClipOriginAllocator::Iter clipOriginIter(&fClipOrigins);
ClearAllocator::Iter clearIter(&fClears);
DrawAllocator::Iter drawIter(&fDraws);
StencilPathAllocator::Iter stencilPathIter(&fStencilPaths);
@@ -644,9 +642,8 @@ void GrInOrderDrawBuffer::flush() {
break;
case kSetClip_Cmd:
SkAssertResult(clipIter.next());
- SkAssertResult(clipOriginIter.next());
- clipData.fClipStack = clipIter.get();
- clipData.fOrigin = *clipOriginIter;
+ clipData.fClipStack = &clipIter->fStack;
+ clipData.fOrigin = clipIter->fOrigin;
fDstGpu->setClip(&clipData);
break;
case kClear_Cmd:
@@ -676,7 +673,6 @@ void GrInOrderDrawBuffer::flush() {
// we should have consumed all the states, clips, etc.
SkASSERT(!stateIter.next());
SkASSERT(!clipIter.next());
- SkASSERT(!clipOriginIter.next());
SkASSERT(!clearIter.next());
SkASSERT(!drawIter.next());
SkASSERT(!copySurfaceIter.next());
@@ -928,12 +924,11 @@ bool GrInOrderDrawBuffer::needsNewState() const {
}
bool GrInOrderDrawBuffer::needsNewClip() const {
- SkASSERT(fClips.count() == fClipOrigins.count());
if (this->getDrawState().isClipState()) {
if (fClipSet &&
(fClips.empty() ||
- fClips.back() != *this->getClip()->fClipStack ||
- fClipOrigins.back() != this->getClip()->fOrigin)) {
+ fClips.back().fStack != *this->getClip()->fClipStack ||
+ fClips.back().fOrigin != this->getClip()->fOrigin)) {
return true;
}
}
@@ -952,8 +947,8 @@ void GrInOrderDrawBuffer::addToCmdBuffer(uint8_t cmd) {
}
void GrInOrderDrawBuffer::recordClip() {
- fClips.push_back(*this->getClip()->fClipStack);
- fClipOrigins.push_back() = this->getClip()->fOrigin;
+ fClips.push_back().fStack = *this->getClip()->fClipStack;
+ fClips.back().fOrigin = this->getClip()->fOrigin;
fClipSet = false;
this->addToCmdBuffer(kSetClip_Cmd);
}
@@ -993,7 +988,6 @@ GrInOrderDrawBuffer::CopySurface* GrInOrderDrawBuffer::recordCopySurface() {
return &fCopySurfaces.push_back();
}
-
void GrInOrderDrawBuffer::clipWillBeSet(const GrClipData* newClipData) {
INHERITED::clipWillBeSet(newClipData);
fClipSet = true;
« no previous file with comments | « src/gpu/GrInOrderDrawBuffer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698