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

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

Issue 18341007: Minor GrContext/GrInOrderDrawBuffer cleanup (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 5 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
« no previous file with comments | « 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 427 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 fStates.reset(); 438 fStates.reset();
439 fClears.reset(); 439 fClears.reset();
440 fVertexPool.reset(); 440 fVertexPool.reset();
441 fIndexPool.reset(); 441 fIndexPool.reset();
442 fClips.reset(); 442 fClips.reset();
443 fClipOrigins.reset(); 443 fClipOrigins.reset();
444 fCopySurfaces.reset(); 444 fCopySurfaces.reset();
445 fClipSet = true; 445 fClipSet = true;
446 } 446 }
447 447
448 bool GrInOrderDrawBuffer::flush() { 448 void GrInOrderDrawBuffer::flush() {
449 if (fFlushing) {
450 return;
451 }
452
449 GrAssert(kReserved_GeometrySrcType != this->getGeomSrc().fVertexSrc); 453 GrAssert(kReserved_GeometrySrcType != this->getGeomSrc().fVertexSrc);
450 GrAssert(kReserved_GeometrySrcType != this->getGeomSrc().fIndexSrc); 454 GrAssert(kReserved_GeometrySrcType != this->getGeomSrc().fIndexSrc);
451 455
452 int numCmds = fCmds.count(); 456 int numCmds = fCmds.count();
453 if (0 == numCmds) { 457 if (0 == numCmds) {
454 return false; 458 return;
455 } 459 }
456 GrAssert(!fFlushing);
bsalomon 2013/07/03 18:34:21 Is this assertion no longer valid?
robertphillips 2013/07/03 18:37:45 It shouldn't ever fire since we are returning at t
457 460
458 GrAutoTRestore<bool> flushRestore(&fFlushing); 461 GrAutoTRestore<bool> flushRestore(&fFlushing);
459 fFlushing = true; 462 fFlushing = true;
460 463
461 fVertexPool.unlock(); 464 fVertexPool.unlock();
462 fIndexPool.unlock(); 465 fIndexPool.unlock();
463 466
464 GrDrawTarget::AutoClipRestore acr(fDstGpu); 467 GrDrawTarget::AutoClipRestore acr(fDstGpu);
465 AutoGeometryAndStatePush agasp(fDstGpu, kPreserve_ASRInit); 468 AutoGeometryAndStatePush agasp(fDstGpu, kPreserve_ASRInit);
466 469
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
526 GrAssert(fStates.count() == currState); 529 GrAssert(fStates.count() == currState);
527 GrAssert(fClips.count() == currClip); 530 GrAssert(fClips.count() == currClip);
528 GrAssert(fClipOrigins.count() == currClip); 531 GrAssert(fClipOrigins.count() == currClip);
529 GrAssert(fClears.count() == currClear); 532 GrAssert(fClears.count() == currClear);
530 GrAssert(fDraws.count() == currDraw); 533 GrAssert(fDraws.count() == currDraw);
531 GrAssert(fCopySurfaces.count() == currCopySurface); 534 GrAssert(fCopySurfaces.count() == currCopySurface);
532 535
533 fDstGpu->setDrawState(prevDrawState); 536 fDstGpu->setDrawState(prevDrawState);
534 prevDrawState->unref(); 537 prevDrawState->unref();
535 this->reset(); 538 this->reset();
536 return true;
537 } 539 }
538 540
539 bool GrInOrderDrawBuffer::onCopySurface(GrSurface* dst, 541 bool GrInOrderDrawBuffer::onCopySurface(GrSurface* dst,
540 GrSurface* src, 542 GrSurface* src,
541 const SkIRect& srcRect, 543 const SkIRect& srcRect,
542 const SkIPoint& dstPoint) { 544 const SkIPoint& dstPoint) {
543 if (fDstGpu->canCopySurface(dst, src, srcRect, dstPoint)) { 545 if (fDstGpu->canCopySurface(dst, src, srcRect, dstPoint)) {
544 CopySurface* cs = this->recordCopySurface(); 546 CopySurface* cs = this->recordCopySurface();
545 cs->fDst.reset(SkRef(dst)); 547 cs->fDst.reset(SkRef(dst));
546 cs->fSrc.reset(SkRef(src)); 548 cs->fSrc.reset(SkRef(src));
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
816 fCmds.push_back(kCopySurface_Cmd); 818 fCmds.push_back(kCopySurface_Cmd);
817 return &fCopySurfaces.push_back(); 819 return &fCopySurfaces.push_back();
818 } 820 }
819 821
820 822
821 void GrInOrderDrawBuffer::clipWillBeSet(const GrClipData* newClipData) { 823 void GrInOrderDrawBuffer::clipWillBeSet(const GrClipData* newClipData) {
822 INHERITED::clipWillBeSet(newClipData); 824 INHERITED::clipWillBeSet(newClipData);
823 fClipSet = true; 825 fClipSet = true;
824 fClipProxyState = kUnknown_ClipProxyState; 826 fClipProxyState = kUnknown_ClipProxyState;
825 } 827 }
OLDNEW
« 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