| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |