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

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

Issue 1468423002: Sniff out rects, ovals & rrects in SkGpuDevice::drawPath (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years 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 | src/gpu/SkGpuDevice.cpp » ('j') | 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 2015 Google Inc. 3 * Copyright 2015 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 "GrAtlasTextContext.h" 9 #include "GrAtlasTextContext.h"
10 #include "GrBatchTest.h" 10 #include "GrBatchTest.h"
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 } 236 }
237 237
238 void GrDrawContext::drawRect(const GrClip& clip, 238 void GrDrawContext::drawRect(const GrClip& clip,
239 const GrPaint& paint, 239 const GrPaint& paint,
240 const SkMatrix& viewMatrix, 240 const SkMatrix& viewMatrix,
241 const SkRect& rect, 241 const SkRect& rect,
242 const GrStrokeInfo* strokeInfo) { 242 const GrStrokeInfo* strokeInfo) {
243 RETURN_IF_ABANDONED 243 RETURN_IF_ABANDONED
244 SkDEBUGCODE(this->validate();) 244 SkDEBUGCODE(this->validate();)
245 245
246 if (strokeInfo && strokeInfo->isDashed()) { 246 // Dashing should've been devolved to a path in SkGpuDevice
247 SkPath path; 247 SkASSERT(!strokeInfo || !strokeInfo->isDashed());
248 path.setIsVolatile(true);
249 path.addRect(rect);
250 this->drawPath(clip, paint, viewMatrix, path, *strokeInfo);
251 return;
252 }
253 248
254 AutoCheckFlush acf(fDrawingManager); 249 AutoCheckFlush acf(fDrawingManager);
255 250
256 GrPipelineBuilder pipelineBuilder(paint, fRenderTarget, clip); 251 GrPipelineBuilder pipelineBuilder(paint, fRenderTarget, clip);
257 252
258 SkScalar width = nullptr == strokeInfo ? -1 : strokeInfo->getWidth(); 253 SkScalar width = nullptr == strokeInfo ? -1 : strokeInfo->getWidth();
259 254
260 // Check if this is a full RT draw and can be replaced with a clear. We don' t bother checking 255 // Check if this is a full RT draw and can be replaced with a clear. We don' t bother checking
261 // cases where the RT is fully inside a stroke. 256 // cases where the RT is fully inside a stroke.
262 if (width < 0) { 257 if (width < 0) {
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after
801 args.fAntiAlias = useCoverageAA; 796 args.fAntiAlias = useCoverageAA;
802 pr->drawPath(args); 797 pr->drawPath(args);
803 } 798 }
804 799
805 void GrDrawContext::drawBatch(GrPipelineBuilder* pipelineBuilder, GrDrawBatch* b atch) { 800 void GrDrawContext::drawBatch(GrPipelineBuilder* pipelineBuilder, GrDrawBatch* b atch) {
806 RETURN_IF_ABANDONED 801 RETURN_IF_ABANDONED
807 SkDEBUGCODE(this->validate();) 802 SkDEBUGCODE(this->validate();)
808 803
809 this->getDrawTarget()->drawBatch(*pipelineBuilder, batch); 804 this->getDrawTarget()->drawBatch(*pipelineBuilder, batch);
810 } 805 }
OLDNEW
« no previous file with comments | « no previous file | src/gpu/SkGpuDevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698