| 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 "GrDefaultGeoProcFactory.h" | 10 #include "GrDefaultGeoProcFactory.h" |
| (...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 bool GrInOrderDrawBuffer::onCopySurface(GrSurface* dst, | 386 bool GrInOrderDrawBuffer::onCopySurface(GrSurface* dst, |
| 387 GrSurface* src, | 387 GrSurface* src, |
| 388 const SkIRect& srcRect, | 388 const SkIRect& srcRect, |
| 389 const SkIPoint& dstPoint) { | 389 const SkIPoint& dstPoint) { |
| 390 GrTargetCommands::Cmd* cmd = fCommands.recordCopySurface(this, dst, src, | 390 GrTargetCommands::Cmd* cmd = fCommands.recordCopySurface(this, dst, src, |
| 391 srcRect, dstPoint); | 391 srcRect, dstPoint); |
| 392 this->recordTraceMarkersIfNecessary(cmd); | 392 this->recordTraceMarkersIfNecessary(cmd); |
| 393 return SkToBool(cmd); | 393 return SkToBool(cmd); |
| 394 } | 394 } |
| 395 | 395 |
| 396 void GrInOrderDrawBuffer::onBlendBarrier() { |
| 397 GrTargetCommands::Cmd* cmd = fCommands.recordBlendBarrier(this); |
| 398 this->recordTraceMarkersIfNecessary(cmd); |
| 399 } |
| 400 |
| 396 void GrInOrderDrawBuffer::recordTraceMarkersIfNecessary(GrTargetCommands::Cmd* c
md) { | 401 void GrInOrderDrawBuffer::recordTraceMarkersIfNecessary(GrTargetCommands::Cmd* c
md) { |
| 397 if (!cmd) { | 402 if (!cmd) { |
| 398 return; | 403 return; |
| 399 } | 404 } |
| 400 const GrTraceMarkerSet& activeTraceMarkers = this->getActiveTraceMarkers(); | 405 const GrTraceMarkerSet& activeTraceMarkers = this->getActiveTraceMarkers(); |
| 401 if (activeTraceMarkers.count() > 0) { | 406 if (activeTraceMarkers.count() > 0) { |
| 402 if (cmd->isTraced()) { | 407 if (cmd->isTraced()) { |
| 403 fGpuCmdMarkers[cmd->markerID()].addSet(activeTraceMarkers); | 408 fGpuCmdMarkers[cmd->markerID()].addSet(activeTraceMarkers); |
| 404 } else { | 409 } else { |
| 405 cmd->setMarkerID(fGpuCmdMarkers.count()); | 410 cmd->setMarkerID(fGpuCmdMarkers.count()); |
| 406 fGpuCmdMarkers.push_back(activeTraceMarkers); | 411 fGpuCmdMarkers.push_back(activeTraceMarkers); |
| 407 } | 412 } |
| 408 } | 413 } |
| 409 } | 414 } |
| 410 | 415 |
| 411 void GrInOrderDrawBuffer::willReserveVertexAndIndexSpace(int vertexCount, | 416 void GrInOrderDrawBuffer::willReserveVertexAndIndexSpace(int vertexCount, |
| 412 size_t vertexStride, | 417 size_t vertexStride, |
| 413 int indexCount) { | 418 int indexCount) { |
| 414 fCommands.closeBatch(); | 419 fCommands.closeBatch(); |
| 415 | 420 |
| 416 this->INHERITED::willReserveVertexAndIndexSpace(vertexCount, vertexStride, i
ndexCount); | 421 this->INHERITED::willReserveVertexAndIndexSpace(vertexCount, vertexStride, i
ndexCount); |
| 417 } | 422 } |
| OLD | NEW |