OLD | NEW |
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 "GrBatch.h" | 9 #include "GrBatch.h" |
10 #include "GrBatchFontCache.h" | 10 #include "GrBatchFontCache.h" |
(...skipping 2216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2227 // We enable distance fields by twiddling a knob on the paint | 2227 // We enable distance fields by twiddling a knob on the paint |
2228 gTextContext = GrAtlasTextContext::Create(context, NULL, gDeviceProperti
es, false); | 2228 gTextContext = GrAtlasTextContext::Create(context, NULL, gDeviceProperti
es, false); |
2229 } | 2229 } |
2230 | 2230 |
2231 // create dummy render target | 2231 // create dummy render target |
2232 GrSurfaceDesc desc; | 2232 GrSurfaceDesc desc; |
2233 desc.fFlags = kRenderTarget_GrSurfaceFlag; | 2233 desc.fFlags = kRenderTarget_GrSurfaceFlag; |
2234 desc.fWidth = 1024; | 2234 desc.fWidth = 1024; |
2235 desc.fHeight = 1024; | 2235 desc.fHeight = 1024; |
2236 desc.fConfig = kRGBA_8888_GrPixelConfig; | 2236 desc.fConfig = kRGBA_8888_GrPixelConfig; |
2237 desc.fSampleCnt = 1; | 2237 desc.fSampleCnt = 0; |
2238 SkAutoTUnref<GrTexture> texture(context->textureProvider()->createTexture(de
sc, true, NULL, 0)); | 2238 SkAutoTUnref<GrTexture> texture(context->textureProvider()->createTexture(de
sc, true, NULL, 0)); |
2239 SkASSERT(texture); | 2239 SkASSERT(texture); |
2240 SkASSERT(NULL != texture->asRenderTarget()); | 2240 SkASSERT(NULL != texture->asRenderTarget()); |
2241 GrRenderTarget* rt = texture->asRenderTarget(); | 2241 GrRenderTarget* rt = texture->asRenderTarget(); |
2242 | 2242 |
2243 // Setup dummy SkPaint / GrPaint | 2243 // Setup dummy SkPaint / GrPaint |
2244 GrColor color = GrRandomColor(random); | 2244 GrColor color = GrRandomColor(random); |
2245 SkMatrix viewMatrix = GrTest::TestMatrixInvertible(random); | 2245 SkMatrix viewMatrix = GrTest::TestMatrixInvertible(random); |
2246 SkPaint skPaint; | 2246 SkPaint skPaint; |
2247 skPaint.setDistanceFieldTextTEMP(random->nextBool()); | 2247 skPaint.setDistanceFieldTextTEMP(random->nextBool()); |
(...skipping 20 matching lines...) Expand all Loading... |
2268 gTextContext->createDrawTextBlob(rt, clip, grPaint, skPaint, viewMat
rix, text, | 2268 gTextContext->createDrawTextBlob(rt, clip, grPaint, skPaint, viewMat
rix, text, |
2269 static_cast<size_t>(textLen), 0, 0,
noClip)); | 2269 static_cast<size_t>(textLen), 0, 0,
noClip)); |
2270 | 2270 |
2271 SkScalar transX = static_cast<SkScalar>(random->nextU()); | 2271 SkScalar transX = static_cast<SkScalar>(random->nextU()); |
2272 SkScalar transY = static_cast<SkScalar>(random->nextU()); | 2272 SkScalar transY = static_cast<SkScalar>(random->nextU()); |
2273 const GrAtlasTextContext::BitmapTextBlob::Run::SubRunInfo& info = blob->fRun
s[0].fSubRunInfo[0]; | 2273 const GrAtlasTextContext::BitmapTextBlob::Run::SubRunInfo& info = blob->fRun
s[0].fSubRunInfo[0]; |
2274 return gTextContext->createBatch(blob, info, textLen, 0, 0, color, transX, t
ransY, skPaint); | 2274 return gTextContext->createBatch(blob, info, textLen, 0, 0, color, transX, t
ransY, skPaint); |
2275 } | 2275 } |
2276 | 2276 |
2277 #endif | 2277 #endif |
OLD | NEW |