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

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

Issue 1117953003: Simple CL to Compute bounds in GrContext::drawVertices (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: use bounds 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 1101 matching lines...) Expand 10 before | Expand all | Expand 10 after
1112 AutoCheckFlush acf(this); 1112 AutoCheckFlush acf(this);
1113 GrPipelineBuilder pipelineBuilder; 1113 GrPipelineBuilder pipelineBuilder;
1114 1114
1115 GrDrawTarget* target = this->prepareToDraw(&pipelineBuilder, rt, clip, &pain t, &acf); 1115 GrDrawTarget* target = this->prepareToDraw(&pipelineBuilder, rt, clip, &pain t, &acf);
1116 if (NULL == target) { 1116 if (NULL == target) {
1117 return; 1117 return;
1118 } 1118 }
1119 1119
1120 GR_CREATE_TRACE_MARKER("GrContext::drawVertices", target); 1120 GR_CREATE_TRACE_MARKER("GrContext::drawVertices", target);
1121 1121
1122 // TODO clients should give us bounds
1123 SkRect bounds;
1124 if (!bounds.setBoundsCheck(positions, vertexCount)) {
1125 SkDebugf("drawVertices call empty bounds\n");
1126 return;
1127 }
1128
1122 DrawVerticesBatch::Geometry geometry; 1129 DrawVerticesBatch::Geometry geometry;
1123 geometry.fColor = paint.getColor(); 1130 geometry.fColor = paint.getColor();
1124 1131
1125 SkAutoTUnref<GrBatch> batch(DrawVerticesBatch::Create(geometry, primitiveTyp e, viewMatrix, 1132 SkAutoTUnref<GrBatch> batch(DrawVerticesBatch::Create(geometry, primitiveTyp e, viewMatrix,
1126 positions, vertexCount , indices, 1133 positions, vertexCount , indices,
1127 indexCount,colors, tex Coords)); 1134 indexCount,colors, tex Coords));
1128 1135
1129 // TODO figure out bounds 1136 // TODO figure out bounds
bsalomon 2015/04/30 21:05:30 rm this comment? (maybe in the bounds into batch c
1130 target->drawBatch(&pipelineBuilder, batch, NULL); 1137 target->drawBatch(&pipelineBuilder, batch, &bounds);
1131 } 1138 }
1132 1139
1133 /////////////////////////////////////////////////////////////////////////////// 1140 ///////////////////////////////////////////////////////////////////////////////
1134 1141
1135 void GrContext::drawRRect(GrRenderTarget*rt, 1142 void GrContext::drawRRect(GrRenderTarget*rt,
1136 const GrClip& clip, 1143 const GrClip& clip,
1137 const GrPaint& paint, 1144 const GrPaint& paint,
1138 const SkMatrix& viewMatrix, 1145 const SkMatrix& viewMatrix,
1139 const SkRRect& rrect, 1146 const SkRRect& rrect,
1140 const GrStrokeInfo& strokeInfo) { 1147 const GrStrokeInfo& strokeInfo) {
(...skipping 867 matching lines...) Expand 10 before | Expand all | Expand 10 after
2008 } 2015 }
2009 } 2016 }
2010 2017
2011 void GrContext::removeGpuTraceMarker(const GrGpuTraceMarker* marker) { 2018 void GrContext::removeGpuTraceMarker(const GrGpuTraceMarker* marker) {
2012 fGpu->removeGpuTraceMarker(marker); 2019 fGpu->removeGpuTraceMarker(marker);
2013 if (fDrawBuffer) { 2020 if (fDrawBuffer) {
2014 fDrawBuffer->removeGpuTraceMarker(marker); 2021 fDrawBuffer->removeGpuTraceMarker(marker);
2015 } 2022 }
2016 } 2023 }
2017 2024
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