| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |