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

Side by Side Diff: src/gpu/effects/GrDashingEffect.cpp

Issue 1806983002: Update how we send draws to gpu backend to reduce state setting. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: nit Created 4 years, 9 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 | « src/gpu/batches/GrVertexBatch.cpp ('k') | src/gpu/gl/GrGLGpu.h » ('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 * Copyright 2014 Google Inc. 2 * Copyright 2014 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 "GrDashingEffect.h" 8 #include "GrDashingEffect.h"
9 9
10 #include "GrBatchFlushState.h" 10 #include "GrBatchFlushState.h"
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 LocalCoords localCoords(this->usesLocalCoords() ? LocalCoords::kUseP osition_Type : 352 LocalCoords localCoords(this->usesLocalCoords() ? LocalCoords::kUseP osition_Type :
353 LocalCoords::kUnus ed_Type); 353 LocalCoords::kUnus ed_Type);
354 gp.reset(CreateForDeviceSpace(color, coverage, localCoords, this->vi ewMatrix())); 354 gp.reset(CreateForDeviceSpace(color, coverage, localCoords, this->vi ewMatrix()));
355 } 355 }
356 356
357 if (!gp) { 357 if (!gp) {
358 SkDebugf("Could not create GrGeometryProcessor\n"); 358 SkDebugf("Could not create GrGeometryProcessor\n");
359 return; 359 return;
360 } 360 }
361 361
362 target->initDraw(gp, this->pipeline()); 362 target->initDraw(gp);
363 363
364 // useAA here means Edge AA or MSAA 364 // useAA here means Edge AA or MSAA
365 bool useAA = this->aaMode() != kBW_DashAAMode; 365 bool useAA = this->aaMode() != kBW_DashAAMode;
366 bool fullDash = this->fullDash(); 366 bool fullDash = this->fullDash();
367 367
368 // We do two passes over all of the dashes. First we setup the start, e nd, and bounds, 368 // We do two passes over all of the dashes. First we setup the start, e nd, and bounds,
369 // rectangles. We preserve all of this work in the rects / draws arrays below. Then we 369 // rectangles. We preserve all of this work in the rects / draws arrays below. Then we
370 // iterate again over these decomposed dashes to generate vertices 370 // iterate again over these decomposed dashes to generate vertices
371 static const int kNumStackDashes = 128; 371 static const int kNumStackDashes = 128;
372 SkSTArray<kNumStackDashes, SkRect, true> rects; 372 SkSTArray<kNumStackDashes, SkRect, true> rects;
(...skipping 926 matching lines...) Expand 10 before | Expand all | Expand 10 after
1299 info.fIntervals = intervals; 1299 info.fIntervals = intervals;
1300 info.fCount = 2; 1300 info.fCount = 2;
1301 info.fPhase = phase; 1301 info.fPhase = phase;
1302 SkDEBUGCODE(bool success = ) strokeInfo.setDashInfo(info); 1302 SkDEBUGCODE(bool success = ) strokeInfo.setDashInfo(info);
1303 SkASSERT(success); 1303 SkASSERT(success);
1304 1304
1305 return create_batch(color, viewMatrix, pts, useAA, strokeInfo, msaaRT); 1305 return create_batch(color, viewMatrix, pts, useAA, strokeInfo, msaaRT);
1306 } 1306 }
1307 1307
1308 #endif 1308 #endif
OLDNEW
« no previous file with comments | « src/gpu/batches/GrVertexBatch.cpp ('k') | src/gpu/gl/GrGLGpu.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698