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 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 geometry.fHasLocalMatrix = false; | 290 geometry.fHasLocalMatrix = false; |
291 } | 291 } |
292 | 292 |
293 SkAutoTUnref<GrBatch> batch(RectBatch::Create(geometry)); | 293 SkAutoTUnref<GrBatch> batch(RectBatch::Create(geometry)); |
294 | 294 |
295 SkRect bounds = rect; | 295 SkRect bounds = rect; |
296 viewMatrix.mapRect(&bounds); | 296 viewMatrix.mapRect(&bounds); |
297 this->drawBatch(pipelineBuilder, batch, &bounds); | 297 this->drawBatch(pipelineBuilder, batch, &bounds); |
298 } | 298 } |
299 | 299 |
300 void GrInOrderDrawBuffer::onDraw(const GrGeometryProcessor* gp, | |
301 const DrawInfo& info, | |
302 const PipelineInfo& pipelineInfo) { | |
303 GrTargetCommands::Cmd* cmd = fCommands.recordDraw(this, gp, info, pipelineIn
fo); | |
304 this->recordTraceMarkersIfNecessary(cmd); | |
305 } | |
306 | |
307 void GrInOrderDrawBuffer::onDrawBatch(GrBatch* batch, | 300 void GrInOrderDrawBuffer::onDrawBatch(GrBatch* batch, |
308 const PipelineInfo& pipelineInfo) { | 301 const PipelineInfo& pipelineInfo) { |
309 GrTargetCommands::Cmd* cmd = fCommands.recordDrawBatch(this, batch, pipeline
Info); | 302 GrTargetCommands::Cmd* cmd = fCommands.recordDrawBatch(this, batch, pipeline
Info); |
310 this->recordTraceMarkersIfNecessary(cmd); | 303 this->recordTraceMarkersIfNecessary(cmd); |
311 } | 304 } |
312 | 305 |
313 void GrInOrderDrawBuffer::onStencilPath(const GrPipelineBuilder& pipelineBuilder
, | 306 void GrInOrderDrawBuffer::onStencilPath(const GrPipelineBuilder& pipelineBuilder
, |
314 const GrPathProcessor* pathProc, | 307 const GrPathProcessor* pathProc, |
315 const GrPath* path, | 308 const GrPath* path, |
316 const GrScissorState& scissorState, | 309 const GrScissorState& scissorState, |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 const GrTraceMarkerSet& activeTraceMarkers = this->getActiveTraceMarkers(); | 393 const GrTraceMarkerSet& activeTraceMarkers = this->getActiveTraceMarkers(); |
401 if (activeTraceMarkers.count() > 0) { | 394 if (activeTraceMarkers.count() > 0) { |
402 if (cmd->isTraced()) { | 395 if (cmd->isTraced()) { |
403 fGpuCmdMarkers[cmd->markerID()].addSet(activeTraceMarkers); | 396 fGpuCmdMarkers[cmd->markerID()].addSet(activeTraceMarkers); |
404 } else { | 397 } else { |
405 cmd->setMarkerID(fGpuCmdMarkers.count()); | 398 cmd->setMarkerID(fGpuCmdMarkers.count()); |
406 fGpuCmdMarkers.push_back(activeTraceMarkers); | 399 fGpuCmdMarkers.push_back(activeTraceMarkers); |
407 } | 400 } |
408 } | 401 } |
409 } | 402 } |
410 | |
411 void GrInOrderDrawBuffer::willReserveVertexAndIndexSpace(int vertexCount, | |
412 size_t vertexStride, | |
413 int indexCount) { | |
414 #ifndef USE_BITMAP_TEXTBLOBS | |
415 fCommands.closeBatch(); | |
416 #endif | |
417 | |
418 this->INHERITED::willReserveVertexAndIndexSpace(vertexCount, vertexStride, i
ndexCount); | |
419 } | |
OLD | NEW |