OLD | NEW |
| 1 /* |
| 2 * Copyright 2013 Google Inc. |
| 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. |
| 6 */ |
| 7 |
1 #include "GrPathProcessor.h" | 8 #include "GrPathProcessor.h" |
2 | 9 |
3 #include "gl/GrGLPathProcessor.h" | 10 #include "gl/GrGLPathProcessor.h" |
4 #include "gl/GrGLGpu.h" | 11 #include "gl/GrGLGpu.h" |
5 | 12 |
6 GrPathProcessor::GrPathProcessor(GrColor color, | 13 GrPathProcessor::GrPathProcessor(GrColor color, |
7 const SkMatrix& viewMatrix, | 14 const SkMatrix& viewMatrix, |
8 const SkMatrix& localMatrix) | 15 const SkMatrix& localMatrix) |
9 : INHERITED(viewMatrix, localMatrix, true) | 16 : INHERITED(viewMatrix, localMatrix, true) |
10 , fColor(color) { | 17 , fColor(color) { |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 } | 63 } |
57 | 64 |
58 void GrPathProcessor::getGLProcessorKey(const GrBatchTracker& bt, | 65 void GrPathProcessor::getGLProcessorKey(const GrBatchTracker& bt, |
59 const GrGLCaps& caps, | 66 const GrGLCaps& caps, |
60 GrProcessorKeyBuilder* b) const { | 67 GrProcessorKeyBuilder* b) const { |
61 GrGLPathProcessor::GenKey(*this, bt, caps, b); | 68 GrGLPathProcessor::GenKey(*this, bt, caps, b); |
62 } | 69 } |
63 | 70 |
64 GrGLPrimitiveProcessor* GrPathProcessor::createGLInstance(const GrBatchTracker&
bt, | 71 GrGLPrimitiveProcessor* GrPathProcessor::createGLInstance(const GrBatchTracker&
bt, |
65 const GrGLCaps& caps)
const { | 72 const GrGLCaps& caps)
const { |
66 SkASSERT(caps.nvprSupport() != GrGLCaps::kNone_NvprSupport); | 73 SkASSERT(caps.pathRenderingSupport()); |
67 if (caps.nvprSupport() == GrGLCaps::kLegacy_NvprSupport) { | 74 return SkNEW_ARGS(GrGLPathProcessor, (*this, bt)); |
68 return SkNEW_ARGS(GrGLLegacyPathProcessor, (*this, bt, | |
69 caps.maxFixedFunctionTexture
Coords())); | |
70 } else { | |
71 return SkNEW_ARGS(GrGLNormalPathProcessor, (*this, bt)); | |
72 } | |
73 } | 75 } |
OLD | NEW |