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 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
354 draw->fInfo.adjustStartVertex(poolState.fPoolStartVertex); | 354 draw->fInfo.adjustStartVertex(poolState.fPoolStartVertex); |
355 } | 355 } |
356 | 356 |
357 if (info.isIndexed() && kBuffer_GeometrySrcType != this->getGeomSrc().fIndex
Src) { | 357 if (info.isIndexed() && kBuffer_GeometrySrcType != this->getGeomSrc().fIndex
Src) { |
358 size_t bytes = (info.indexCount() + info.startIndex()) * sizeof(uint16_t
); | 358 size_t bytes = (info.indexCount() + info.startIndex()) * sizeof(uint16_t
); |
359 poolState.fUsedPoolIndexBytes = SkTMax(poolState.fUsedPoolIndexBytes, by
tes); | 359 poolState.fUsedPoolIndexBytes = SkTMax(poolState.fUsedPoolIndexBytes, by
tes); |
360 draw->fInfo.adjustStartIndex(poolState.fPoolStartIndex); | 360 draw->fInfo.adjustStartIndex(poolState.fPoolStartIndex); |
361 } | 361 } |
362 } | 362 } |
363 | 363 |
364 void GrInOrderDrawBuffer::onStencilPath(const GrPath* path, SkPath::FillType fil
l) { | 364 void GrInOrderDrawBuffer::onStencilPath(const GrPath* path, GrPathRendering::Fil
lType fill) { |
365 this->recordClipIfNecessary(); | 365 this->recordClipIfNecessary(); |
366 // Only compare the subset of GrDrawState relevant to path stenciling? | 366 // Only compare the subset of GrDrawState relevant to path stenciling? |
367 this->recordStateIfNecessary(); | 367 this->recordStateIfNecessary(); |
368 StencilPath* sp = GrNEW_APPEND_TO_RECORDER(fCmdBuffer, StencilPath, (path)); | 368 StencilPath* sp = GrNEW_APPEND_TO_RECORDER(fCmdBuffer, StencilPath, (path)); |
369 sp->fFill = fill; | 369 sp->fFill = fill; |
370 this->recordTraceMarkersIfNecessary(); | 370 this->recordTraceMarkersIfNecessary(); |
371 } | 371 } |
372 | 372 |
373 void GrInOrderDrawBuffer::onDrawPath(const GrPath* path, | 373 void GrInOrderDrawBuffer::onDrawPath(const GrPath* path, |
374 SkPath::FillType fill, const GrDeviceCoordT
exture* dstCopy) { | 374 GrPathRendering::FillType fill, |
| 375 const GrDeviceCoordTexture* dstCopy) { |
375 this->recordClipIfNecessary(); | 376 this->recordClipIfNecessary(); |
376 // TODO: Only compare the subset of GrDrawState relevant to path covering? | 377 // TODO: Only compare the subset of GrDrawState relevant to path covering? |
377 this->recordStateIfNecessary(); | 378 this->recordStateIfNecessary(); |
378 DrawPath* dp = GrNEW_APPEND_TO_RECORDER(fCmdBuffer, DrawPath, (path)); | 379 DrawPath* dp = GrNEW_APPEND_TO_RECORDER(fCmdBuffer, DrawPath, (path)); |
379 dp->fFill = fill; | 380 dp->fFill = fill; |
380 if (dstCopy) { | 381 if (dstCopy) { |
381 dp->fDstCopy = *dstCopy; | 382 dp->fDstCopy = *dstCopy; |
382 } | 383 } |
383 this->recordTraceMarkersIfNecessary(); | 384 this->recordTraceMarkersIfNecessary(); |
384 } | 385 } |
385 | 386 |
386 void GrInOrderDrawBuffer::onDrawPaths(const GrPathRange* pathRange, | 387 void GrInOrderDrawBuffer::onDrawPaths(const GrPathRange* pathRange, |
387 const uint32_t indices[], int count, | 388 const uint32_t indices[], int count, |
388 const float transforms[], PathTransformTyp
e transformsType, | 389 const float transforms[], PathTransformTyp
e transformsType, |
389 SkPath::FillType fill, const GrDeviceCoord
Texture* dstCopy) { | 390 GrPathRendering::FillType fill, |
| 391 const GrDeviceCoordTexture* dstCopy) { |
390 SkASSERT(pathRange); | 392 SkASSERT(pathRange); |
391 SkASSERT(indices); | 393 SkASSERT(indices); |
392 SkASSERT(transforms); | 394 SkASSERT(transforms); |
393 | 395 |
394 this->recordClipIfNecessary(); | 396 this->recordClipIfNecessary(); |
395 this->recordStateIfNecessary(); | 397 this->recordStateIfNecessary(); |
396 | 398 |
397 int sizeOfIndices = sizeof(uint32_t) * count; | 399 int sizeOfIndices = sizeof(uint32_t) * count; |
398 int sizeOfTransforms = sizeof(float) * count * | 400 int sizeOfTransforms = sizeof(float) * count * |
399 GrPathRendering::PathTransformSize(transformsType); | 401 GrPathRendering::PathTransformSize(transformsType); |
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
858 fCmdBuffer.back().fType = add_trace_bit(fCmdBuffer.back().fType); | 860 fCmdBuffer.back().fType = add_trace_bit(fCmdBuffer.back().fType); |
859 fGpuCmdMarkers.push_back(activeTraceMarkers); | 861 fGpuCmdMarkers.push_back(activeTraceMarkers); |
860 } | 862 } |
861 } | 863 } |
862 | 864 |
863 void GrInOrderDrawBuffer::clipWillBeSet(const GrClipData* newClipData) { | 865 void GrInOrderDrawBuffer::clipWillBeSet(const GrClipData* newClipData) { |
864 INHERITED::clipWillBeSet(newClipData); | 866 INHERITED::clipWillBeSet(newClipData); |
865 fClipSet = true; | 867 fClipSet = true; |
866 fClipProxyState = kUnknown_ClipProxyState; | 868 fClipProxyState = kUnknown_ClipProxyState; |
867 } | 869 } |
OLD | NEW |