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

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

Issue 680413005: Don't allow renderTarget==NULL to GrContext::clear() and friends. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Address comment 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 | « src/gpu/GrGpu.cpp ('k') | src/gpu/SkGpuDevice.cpp » ('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 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 renderTarget = this->drawState()->getRenderTarget(); 443 renderTarget = this->drawState()->getRenderTarget();
444 SkASSERT(renderTarget); 444 SkASSERT(renderTarget);
445 } 445 }
446 ClearStencilClip* clr = GrNEW_APPEND_TO_RECORDER(fCmdBuffer, ClearStencilCli p, (renderTarget)); 446 ClearStencilClip* clr = GrNEW_APPEND_TO_RECORDER(fCmdBuffer, ClearStencilCli p, (renderTarget));
447 clr->fRect = rect; 447 clr->fRect = rect;
448 clr->fInsideClip = insideClip; 448 clr->fInsideClip = insideClip;
449 this->recordTraceMarkersIfNecessary(); 449 this->recordTraceMarkersIfNecessary();
450 } 450 }
451 451
452 void GrInOrderDrawBuffer::discard(GrRenderTarget* renderTarget) { 452 void GrInOrderDrawBuffer::discard(GrRenderTarget* renderTarget) {
453 SkASSERT(renderTarget);
453 if (!this->caps()->discardRenderTargetSupport()) { 454 if (!this->caps()->discardRenderTargetSupport()) {
454 return; 455 return;
455 } 456 }
456 if (NULL == renderTarget) {
457 renderTarget = this->drawState()->getRenderTarget();
458 SkASSERT(renderTarget);
459 }
460 Clear* clr = GrNEW_APPEND_TO_RECORDER(fCmdBuffer, Clear, (renderTarget)); 457 Clear* clr = GrNEW_APPEND_TO_RECORDER(fCmdBuffer, Clear, (renderTarget));
461 clr->fColor = GrColor_ILLEGAL; 458 clr->fColor = GrColor_ILLEGAL;
462 this->recordTraceMarkersIfNecessary(); 459 this->recordTraceMarkersIfNecessary();
463 } 460 }
464 461
465 void GrInOrderDrawBuffer::reset() { 462 void GrInOrderDrawBuffer::reset() {
466 SkASSERT(1 == fGeoPoolStateStack.count()); 463 SkASSERT(1 == fGeoPoolStateStack.count());
467 this->resetVertexSource(); 464 this->resetVertexSource();
468 this->resetIndexSource(); 465 this->resetIndexSource();
469 466
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after
859 fCmdBuffer.back().fType = add_trace_bit(fCmdBuffer.back().fType); 856 fCmdBuffer.back().fType = add_trace_bit(fCmdBuffer.back().fType);
860 fGpuCmdMarkers.push_back(activeTraceMarkers); 857 fGpuCmdMarkers.push_back(activeTraceMarkers);
861 } 858 }
862 } 859 }
863 860
864 void GrInOrderDrawBuffer::clipWillBeSet(const GrClipData* newClipData) { 861 void GrInOrderDrawBuffer::clipWillBeSet(const GrClipData* newClipData) {
865 INHERITED::clipWillBeSet(newClipData); 862 INHERITED::clipWillBeSet(newClipData);
866 fClipSet = true; 863 fClipSet = true;
867 fClipProxyState = kUnknown_ClipProxyState; 864 fClipProxyState = kUnknown_ClipProxyState;
868 } 865 }
OLDNEW
« no previous file with comments | « src/gpu/GrGpu.cpp ('k') | src/gpu/SkGpuDevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698