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

Side by Side Diff: src/gpu/GrAtlasTextContext.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/effects/gradients/SkRadialGradient.cpp ('k') | src/gpu/GrBatchFontCache.h » ('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 * Copyright 2015 Google Inc. 2 * Copyright 2015 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 #include "GrAtlasTextContext.h" 7 #include "GrAtlasTextContext.h"
8 8
9 #include "GrBatchFontCache.h" 9 #include "GrBatchFontCache.h"
10 #include "GrBatchFlushState.h" 10 #include "GrBatchFlushState.h"
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 96
97 }; 97 };
98 98
99 GrAtlasTextContext::GrAtlasTextContext(GrContext* context, 99 GrAtlasTextContext::GrAtlasTextContext(GrContext* context,
100 GrDrawContext* drawContext, 100 GrDrawContext* drawContext,
101 const SkSurfaceProps& surfaceProps) 101 const SkSurfaceProps& surfaceProps)
102 : INHERITED(context, drawContext, surfaceProps) 102 : INHERITED(context, drawContext, surfaceProps)
103 , fDistanceAdjustTable(SkNEW(DistanceAdjustTable)) { 103 , fDistanceAdjustTable(SkNEW(DistanceAdjustTable)) {
104 // We overallocate vertices in our textblobs based on the assumption that A8 has the greatest 104 // We overallocate vertices in our textblobs based on the assumption that A8 has the greatest
105 // vertexStride 105 // vertexStride
106 SK_COMPILE_ASSERT(kGrayTextVASize >= kColorTextVASize && kGrayTextVASize >= kLCDTextVASize, 106 static_assert(kGrayTextVASize >= kColorTextVASize && kGrayTextVASize >= kLCD TextVASize,
107 vertex_attribute_changed); 107 "vertex_attribute_changed");
108 fCurrStrike = NULL; 108 fCurrStrike = NULL;
109 fCache = context->getTextBlobCache(); 109 fCache = context->getTextBlobCache();
110 } 110 }
111 111
112 void GrAtlasTextContext::DistanceAdjustTable::buildDistanceAdjustTable() { 112 void GrAtlasTextContext::DistanceAdjustTable::buildDistanceAdjustTable() {
113 113
114 // This is used for an approximation of the mask gamma hack, used by raster and bitmap 114 // This is used for an approximation of the mask gamma hack, used by raster and bitmap
115 // text. The mask gamma hack is based off of guessing what the blend color i s going to 115 // text. The mask gamma hack is based off of guessing what the blend color i s going to
116 // be, and adjusting the mask so that when run through the linear blend will 116 // be, and adjusting the mask so that when run through the linear blend will
117 // produce the value closest to the desired result. However, in practice thi s means 117 // produce the value closest to the desired result. However, in practice thi s means
(...skipping 2168 matching lines...) Expand 10 before | Expand all | Expand 10 after
2286 gTextContext->createDrawTextBlob(rt, clip, grPaint, skPaint, viewMat rix, text, 2286 gTextContext->createDrawTextBlob(rt, clip, grPaint, skPaint, viewMat rix, text,
2287 static_cast<size_t>(textLen), 0, 0, noClip)); 2287 static_cast<size_t>(textLen), 0, 0, noClip));
2288 2288
2289 SkScalar transX = static_cast<SkScalar>(random->nextU()); 2289 SkScalar transX = static_cast<SkScalar>(random->nextU());
2290 SkScalar transY = static_cast<SkScalar>(random->nextU()); 2290 SkScalar transY = static_cast<SkScalar>(random->nextU());
2291 const GrAtlasTextBlob::Run::SubRunInfo& info = blob->fRuns[0].fSubRunInfo[0] ; 2291 const GrAtlasTextBlob::Run::SubRunInfo& info = blob->fRuns[0].fSubRunInfo[0] ;
2292 return gTextContext->createBatch(blob, info, textLen, 0, 0, color, transX, t ransY, skPaint); 2292 return gTextContext->createBatch(blob, info, textLen, 0, 0, color, transX, t ransY, skPaint);
2293 } 2293 }
2294 2294
2295 #endif 2295 #endif
OLDNEW
« no previous file with comments | « src/effects/gradients/SkRadialGradient.cpp ('k') | src/gpu/GrBatchFontCache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698