OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 #include "GrGLPath.h" | 9 #include "GrGLPath.h" |
10 #include "GrGLPathRendering.h" | 10 #include "GrGLPathRendering.h" |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 int pointCnt = skPath.countPoints(); | 98 int pointCnt = skPath.countPoints(); |
99 int minCoordCnt = pointCnt * 2; | 99 int minCoordCnt = pointCnt * 2; |
100 | 100 |
101 SkSTArray<16, GrGLubyte, true> pathCommands(verbCnt); | 101 SkSTArray<16, GrGLubyte, true> pathCommands(verbCnt); |
102 SkSTArray<16, GrGLfloat, true> pathCoords(minCoordCnt); | 102 SkSTArray<16, GrGLfloat, true> pathCoords(minCoordCnt); |
103 | 103 |
104 SkDEBUGCODE(int numCoords = 0); | 104 SkDEBUGCODE(int numCoords = 0); |
105 | 105 |
106 if ((skPath.getSegmentMasks() & SkPath::kConic_SegmentMask) == 0) { | 106 if ((skPath.getSegmentMasks() & SkPath::kConic_SegmentMask) == 0) { |
107 // This branch does type punning, converting SkPoint* to GrGLfloat*. | 107 // This branch does type punning, converting SkPoint* to GrGLfloat*. |
108 SK_COMPILE_ASSERT(sizeof(SkPoint) == sizeof(GrGLfloat) * 2, sk_point
_not_two_floats); | 108 static_assert(sizeof(SkPoint) == sizeof(GrGLfloat) * 2, "sk_point_no
t_two_floats"); |
109 // This branch does not convert with SkScalarToFloat. | 109 // This branch does not convert with SkScalarToFloat. |
110 #ifndef SK_SCALAR_IS_FLOAT | 110 #ifndef SK_SCALAR_IS_FLOAT |
111 #error Need SK_SCALAR_IS_FLOAT. | 111 #error Need SK_SCALAR_IS_FLOAT. |
112 #endif | 112 #endif |
113 pathCommands.resize_back(verbCnt); | 113 pathCommands.resize_back(verbCnt); |
114 pathCoords.resize_back(minCoordCnt); | 114 pathCoords.resize_back(minCoordCnt); |
115 skPath.getPoints(reinterpret_cast<SkPoint*>(&pathCoords[0]), pointCn
t); | 115 skPath.getPoints(reinterpret_cast<SkPoint*>(&pathCoords[0]), pointCn
t); |
116 skPath.getVerbs(&pathCommands[0], verbCnt); | 116 skPath.getVerbs(&pathCommands[0], verbCnt); |
117 for (int i = 0; i < verbCnt; ++i) { | 117 for (int i = 0; i < verbCnt; ++i) { |
118 SkPath::Verb v = static_cast<SkPath::Verb>(pathCommands[i]); | 118 SkPath::Verb v = static_cast<SkPath::Verb>(pathCommands[i]); |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 } | 220 } |
221 | 221 |
222 INHERITED::onRelease(); | 222 INHERITED::onRelease(); |
223 } | 223 } |
224 | 224 |
225 void GrGLPath::onAbandon() { | 225 void GrGLPath::onAbandon() { |
226 fPathID = 0; | 226 fPathID = 0; |
227 | 227 |
228 INHERITED::onAbandon(); | 228 INHERITED::onAbandon(); |
229 } | 229 } |
OLD | NEW |