Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(596)

Side by Side Diff: src/gpu/gl/GrGLPath.cpp

Issue 1306443004: Use static_assert instead of SK_COMPILE_ASSERT. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/gpu/GrStrokeInfo.cpp ('k') | src/images/SkScaledBitmapSampler.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « src/gpu/GrStrokeInfo.cpp ('k') | src/images/SkScaledBitmapSampler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698