Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(57)

Side by Side Diff: src/gpu/GrContext.cpp

Issue 1127633003: trivial fix for drawvertices bounds (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698