| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 #include "GrContext.h" | 9 #include "GrContext.h" |
| 10 | 10 |
| (...skipping 1001 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1012 | 1012 |
| 1013 GR_CREATE_TRACE_MARKER("GrContext::drawVertices", target); | 1013 GR_CREATE_TRACE_MARKER("GrContext::drawVertices", target); |
| 1014 | 1014 |
| 1015 // TODO clients should give us bounds | 1015 // TODO clients should give us bounds |
| 1016 SkRect bounds; | 1016 SkRect bounds; |
| 1017 if (!bounds.setBoundsCheck(positions, vertexCount)) { | 1017 if (!bounds.setBoundsCheck(positions, vertexCount)) { |
| 1018 SkDebugf("drawVertices call empty bounds\n"); | 1018 SkDebugf("drawVertices call empty bounds\n"); |
| 1019 return; | 1019 return; |
| 1020 } | 1020 } |
| 1021 | 1021 |
| 1022 viewMatrix.mapRect(&bounds); |
| 1023 |
| 1022 DrawVerticesBatch::Geometry geometry; | 1024 DrawVerticesBatch::Geometry geometry; |
| 1023 geometry.fColor = paint.getColor(); | 1025 geometry.fColor = paint.getColor(); |
| 1024 SkAutoTUnref<GrBatch> batch(DrawVerticesBatch::Create(geometry, primitiveTyp
e, viewMatrix, | 1026 SkAutoTUnref<GrBatch> batch(DrawVerticesBatch::Create(geometry, primitiveTyp
e, viewMatrix, |
| 1025 positions, vertexCount
, indices, | 1027 positions, vertexCount
, indices, |
| 1026 indexCount, colors, te
xCoords, | 1028 indexCount, colors, te
xCoords, |
| 1027 bounds)); | 1029 bounds)); |
| 1028 | 1030 |
| 1029 target->drawBatch(&pipelineBuilder, batch); | 1031 target->drawBatch(&pipelineBuilder, batch); |
| 1030 } | 1032 } |
| 1031 | 1033 |
| (...skipping 858 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1890 fDrawBuffer->addGpuTraceMarker(marker); | 1892 fDrawBuffer->addGpuTraceMarker(marker); |
| 1891 } | 1893 } |
| 1892 } | 1894 } |
| 1893 | 1895 |
| 1894 void GrContext::removeGpuTraceMarker(const GrGpuTraceMarker* marker) { | 1896 void GrContext::removeGpuTraceMarker(const GrGpuTraceMarker* marker) { |
| 1895 fGpu->removeGpuTraceMarker(marker); | 1897 fGpu->removeGpuTraceMarker(marker); |
| 1896 if (fDrawBuffer) { | 1898 if (fDrawBuffer) { |
| 1897 fDrawBuffer->removeGpuTraceMarker(marker); | 1899 fDrawBuffer->removeGpuTraceMarker(marker); |
| 1898 } | 1900 } |
| 1899 } | 1901 } |
| OLD | NEW |