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

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

Issue 742853002: Don't use NULL GrOptDrawState to indicate that draw should be skipped. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Make bool cast work Created 6 years, 1 month 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
« no previous file with comments | « include/gpu/GrGpuResourceRef.h ('k') | src/gpu/GrOptDrawState.h » ('j') | 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 * Copyright 2011 Google Inc. 2 * Copyright 2011 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 #include "GrInOrderDrawBuffer.h" 8 #include "GrInOrderDrawBuffer.h"
9 9
10 #include "GrBufferAllocPool.h" 10 #include "GrBufferAllocPool.h"
(...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after
720 } 720 }
721 if (kReserved_GeometrySrcType == restoredState.fIndexSrc) { 721 if (kReserved_GeometrySrcType == restoredState.fIndexSrc) {
722 poolState.fUsedPoolIndexBytes = sizeof(uint16_t) * restoredState.fIndexC ount; 722 poolState.fUsedPoolIndexBytes = sizeof(uint16_t) * restoredState.fIndexC ount;
723 } 723 }
724 } 724 }
725 725
726 bool GrInOrderDrawBuffer::recordStateAndShouldDraw(const GrDrawState& ds, 726 bool GrInOrderDrawBuffer::recordStateAndShouldDraw(const GrDrawState& ds,
727 GrGpu::DrawType drawType, 727 GrGpu::DrawType drawType,
728 const GrClipMaskManager::Scis sorState& scissor, 728 const GrClipMaskManager::Scis sorState& scissor,
729 const GrDeviceCoordTexture* d stCopy) { 729 const GrDeviceCoordTexture* d stCopy) {
730 SkAutoTUnref<GrOptDrawState> optState(GrOptDrawState::Create(ds, fDstGpu, sc issor, dstCopy, 730 SkAutoTUnref<GrOptDrawState> optState(
731 drawType)); 731 SkNEW_ARGS(GrOptDrawState, (ds, fDstGpu, scissor, dstCopy, drawType)));
732 if (!optState) { 732 if (optState->mustSkip()) {
733 return false; 733 return false;
734 } 734 }
735 if (!fLastState || *optState != *fLastState) { 735 if (!fLastState || *optState != *fLastState) {
736 SetState* ss = GrNEW_APPEND_TO_RECORDER(fCmdBuffer, SetState, (optState) ); 736 SetState* ss = GrNEW_APPEND_TO_RECORDER(fCmdBuffer, SetState, (optState) );
737 fLastState.reset(SkRef(optState.get())); 737 fLastState.reset(SkRef(optState.get()));
738 ss->fDrawType = drawType; 738 ss->fDrawType = drawType;
739 this->recordTraceMarkersIfNecessary(); 739 this->recordTraceMarkersIfNecessary();
740 } 740 }
741 return true; 741 return true;
742 } 742 }
743 743
744 void GrInOrderDrawBuffer::recordTraceMarkersIfNecessary() { 744 void GrInOrderDrawBuffer::recordTraceMarkersIfNecessary() {
745 SkASSERT(!fCmdBuffer.empty()); 745 SkASSERT(!fCmdBuffer.empty());
746 SkASSERT(!cmd_has_trace_marker(fCmdBuffer.back().fType)); 746 SkASSERT(!cmd_has_trace_marker(fCmdBuffer.back().fType));
747 const GrTraceMarkerSet& activeTraceMarkers = this->getActiveTraceMarkers(); 747 const GrTraceMarkerSet& activeTraceMarkers = this->getActiveTraceMarkers();
748 if (activeTraceMarkers.count() > 0) { 748 if (activeTraceMarkers.count() > 0) {
749 fCmdBuffer.back().fType = add_trace_bit(fCmdBuffer.back().fType); 749 fCmdBuffer.back().fType = add_trace_bit(fCmdBuffer.back().fType);
750 fGpuCmdMarkers.push_back(activeTraceMarkers); 750 fGpuCmdMarkers.push_back(activeTraceMarkers);
751 } 751 }
752 } 752 }
OLDNEW
« no previous file with comments | « include/gpu/GrGpuResourceRef.h ('k') | src/gpu/GrOptDrawState.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698