| 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 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 } | 230 } |
| 231 | 231 |
| 232 | 232 |
| 233 void | 233 void |
| 234 GrGLGeometryProcessor::setTransformData(const GrPrimitiveProcessor* primProc, | 234 GrGLGeometryProcessor::setTransformData(const GrPrimitiveProcessor* primProc, |
| 235 const GrGLProgramDataManager& pdman, | 235 const GrGLProgramDataManager& pdman, |
| 236 int index, | 236 int index, |
| 237 const SkTArray<const GrCoordTransform*,
true>& transforms) { | 237 const SkTArray<const GrCoordTransform*,
true>& transforms) { |
| 238 SkSTArray<2, Transform, true>& procTransforms = fInstalledTransforms[index]; | 238 SkSTArray<2, Transform, true>& procTransforms = fInstalledTransforms[index]; |
| 239 int numTransforms = transforms.count(); | 239 int numTransforms = transforms.count(); |
| 240 const SkMatrix& localMatrix = primProc->localMatrix(); |
| 240 for (int t = 0; t < numTransforms; ++t) { | 241 for (int t = 0; t < numTransforms; ++t) { |
| 241 SkASSERT(procTransforms[t].fHandle.isValid()); | 242 SkASSERT(procTransforms[t].fHandle.isValid()); |
| 242 const SkMatrix& transform = GetTransformMatrix(primProc->localMatrix(),
*transforms[t]); | 243 const SkMatrix& transform = GetTransformMatrix(localMatrix, *transforms[
t]); |
| 243 if (!procTransforms[t].fCurrentValue.cheapEqualTo(transform)) { | 244 if (!procTransforms[t].fCurrentValue.cheapEqualTo(transform)) { |
| 244 pdman.setSkMatrix(procTransforms[t].fHandle.convertToUniformHandle()
, transform); | 245 pdman.setSkMatrix(procTransforms[t].fHandle.convertToUniformHandle()
, transform); |
| 245 procTransforms[t].fCurrentValue = transform; | 246 procTransforms[t].fCurrentValue = transform; |
| 246 } | 247 } |
| 247 } | 248 } |
| 248 } | 249 } |
| 249 | 250 |
| 250 ////////////////////////////////////////////////////////////////////////////////
/////////////////// | 251 ////////////////////////////////////////////////////////////////////////////////
/////////////////// |
| 251 | 252 |
| 252 #include "gl/GrGLGpu.h" | 253 #include "gl/GrGLGpu.h" |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 528 const GrGLCaps& caps)
const { | 529 const GrGLCaps& caps)
const { |
| 529 SkASSERT(caps.nvprSupport() != GrGLCaps::kNone_NvprSupport); | 530 SkASSERT(caps.nvprSupport() != GrGLCaps::kNone_NvprSupport); |
| 530 if (caps.nvprSupport() == GrGLCaps::kLegacy_NvprSupport) { | 531 if (caps.nvprSupport() == GrGLCaps::kLegacy_NvprSupport) { |
| 531 return SkNEW_ARGS(GrGLLegacyPathProcessor, (*this, bt, | 532 return SkNEW_ARGS(GrGLLegacyPathProcessor, (*this, bt, |
| 532 caps.maxFixedFunctionTexture
Coords())); | 533 caps.maxFixedFunctionTexture
Coords())); |
| 533 } else { | 534 } else { |
| 534 return SkNEW_ARGS(GrGLNormalPathProcessor, (*this, bt)); | 535 return SkNEW_ARGS(GrGLNormalPathProcessor, (*this, bt)); |
| 535 } | 536 } |
| 536 } | 537 } |
| 537 | 538 |
| OLD | NEW |