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 "GrGeometryProcessor.h" | 8 #include "GrGeometryProcessor.h" |
9 | 9 |
10 #include "GrCoordTransform.h" | 10 #include "GrCoordTransform.h" |
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 pdman.set4fv(fColorUniform, 1, c); | 305 pdman.set4fv(fColorUniform, 1, c); |
306 fColor = local.fColor; | 306 fColor = local.fColor; |
307 } | 307 } |
308 } | 308 } |
309 | 309 |
310 class GrGLLegacyPathProcessor : public GrGLPathProcessor { | 310 class GrGLLegacyPathProcessor : public GrGLPathProcessor { |
311 public: | 311 public: |
312 GrGLLegacyPathProcessor(const GrPathProcessor& pathProc, const GrBatchTracke
r& bt, | 312 GrGLLegacyPathProcessor(const GrPathProcessor& pathProc, const GrBatchTracke
r& bt, |
313 int maxTexCoords) | 313 int maxTexCoords) |
314 : INHERITED(pathProc, bt) | 314 : INHERITED(pathProc, bt) |
315 , fMaxTexCoords(maxTexCoords) | 315 , fTexCoordSetCnt(0) { |
316 , fTexCoordSetCnt(0) {} | 316 SkDEBUGCODE(fMaxTexCoords = maxTexCoords;) |
| 317 } |
317 | 318 |
318 int addTexCoordSets(int count) { | 319 int addTexCoordSets(int count) { |
319 int firstFreeCoordSet = fTexCoordSetCnt; | 320 int firstFreeCoordSet = fTexCoordSetCnt; |
320 fTexCoordSetCnt += count; | 321 fTexCoordSetCnt += count; |
321 SkASSERT(fMaxTexCoords >= fTexCoordSetCnt); | 322 SkASSERT(fMaxTexCoords >= fTexCoordSetCnt); |
322 return firstFreeCoordSet; | 323 return firstFreeCoordSet; |
323 } | 324 } |
324 | 325 |
325 void emitTransforms(GrGLGPBuilder*, const TransformsIn& tin, TransformsOut*
tout) SK_OVERRIDE { | 326 void emitTransforms(GrGLGPBuilder*, const TransformsIn& tin, TransformsOut*
tout) SK_OVERRIDE { |
326 tout->push_back_n(tin.count()); | 327 tout->push_back_n(tin.count()); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 } | 362 } |
362 glpr->enablePathTexGen(texCoordIndex++, components, transform); | 363 glpr->enablePathTexGen(texCoordIndex++, components, transform); |
363 } | 364 } |
364 } | 365 } |
365 | 366 |
366 void didSetData(GrGLPathRendering* glpr) SK_OVERRIDE { | 367 void didSetData(GrGLPathRendering* glpr) SK_OVERRIDE { |
367 glpr->flushPathTexGenSettings(fTexCoordSetCnt); | 368 glpr->flushPathTexGenSettings(fTexCoordSetCnt); |
368 } | 369 } |
369 | 370 |
370 private: | 371 private: |
371 int fMaxTexCoords; | 372 SkDEBUGCODE(int fMaxTexCoords;) |
372 int fTexCoordSetCnt; | 373 int fTexCoordSetCnt; |
373 | 374 |
374 typedef GrGLPathProcessor INHERITED; | 375 typedef GrGLPathProcessor INHERITED; |
375 }; | 376 }; |
376 | 377 |
377 class GrGLNormalPathProcessor : public GrGLPathProcessor { | 378 class GrGLNormalPathProcessor : public GrGLPathProcessor { |
378 public: | 379 public: |
379 GrGLNormalPathProcessor(const GrPathProcessor& pathProc, const GrBatchTracke
r& bt) | 380 GrGLNormalPathProcessor(const GrPathProcessor& pathProc, const GrBatchTracke
r& bt) |
380 : INHERITED(pathProc, bt) {} | 381 : INHERITED(pathProc, bt) {} |
381 | 382 |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
527 const GrGLCaps& caps)
const { | 528 const GrGLCaps& caps)
const { |
528 SkASSERT(caps.nvprSupport() != GrGLCaps::kNone_NvprSupport); | 529 SkASSERT(caps.nvprSupport() != GrGLCaps::kNone_NvprSupport); |
529 if (caps.nvprSupport() == GrGLCaps::kLegacy_NvprSupport) { | 530 if (caps.nvprSupport() == GrGLCaps::kLegacy_NvprSupport) { |
530 return SkNEW_ARGS(GrGLLegacyPathProcessor, (*this, bt, | 531 return SkNEW_ARGS(GrGLLegacyPathProcessor, (*this, bt, |
531 caps.maxFixedFunctionTexture
Coords())); | 532 caps.maxFixedFunctionTexture
Coords())); |
532 } else { | 533 } else { |
533 return SkNEW_ARGS(GrGLNormalPathProcessor, (*this, bt)); | 534 return SkNEW_ARGS(GrGLNormalPathProcessor, (*this, bt)); |
534 } | 535 } |
535 } | 536 } |
536 | 537 |
OLD | NEW |