| 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 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 453 } | 453 } |
| 454 | 454 |
| 455 if (!fEnableDFRendering && !skPaint.isDistanceFieldTextTEMP() && | 455 if (!fEnableDFRendering && !skPaint.isDistanceFieldTextTEMP() && |
| 456 scaledTextSize < kLargeDFFontSize) { | 456 scaledTextSize < kLargeDFFontSize) { |
| 457 return false; | 457 return false; |
| 458 } | 458 } |
| 459 | 459 |
| 460 // rasterizers and mask filters modify alpha, which doesn't | 460 // rasterizers and mask filters modify alpha, which doesn't |
| 461 // translate well to distance | 461 // translate well to distance |
| 462 if (skPaint.getRasterizer() || skPaint.getMaskFilter() || | 462 if (skPaint.getRasterizer() || skPaint.getMaskFilter() || |
| 463 !fContext->shaderDerivativeSupport()) { | 463 !fContext->caps()->shaderCaps()->shaderDerivativeSupport()) { |
| 464 return false; | 464 return false; |
| 465 } | 465 } |
| 466 | 466 |
| 467 // TODO: add some stroking support | 467 // TODO: add some stroking support |
| 468 if (skPaint.getStyle() != SkPaint::kFill_Style) { | 468 if (skPaint.getStyle() != SkPaint::kFill_Style) { |
| 469 return false; | 469 return false; |
| 470 } | 470 } |
| 471 | 471 |
| 472 return true; | 472 return true; |
| 473 } | 473 } |
| (...skipping 1811 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2285 gTextContext->createDrawTextBlob(rt, clip, grPaint, skPaint, viewMat
rix, text, | 2285 gTextContext->createDrawTextBlob(rt, clip, grPaint, skPaint, viewMat
rix, text, |
| 2286 static_cast<size_t>(textLen), 0, 0,
noClip)); | 2286 static_cast<size_t>(textLen), 0, 0,
noClip)); |
| 2287 | 2287 |
| 2288 SkScalar transX = static_cast<SkScalar>(random->nextU()); | 2288 SkScalar transX = static_cast<SkScalar>(random->nextU()); |
| 2289 SkScalar transY = static_cast<SkScalar>(random->nextU()); | 2289 SkScalar transY = static_cast<SkScalar>(random->nextU()); |
| 2290 const GrAtlasTextContext::BitmapTextBlob::Run::SubRunInfo& info = blob->fRun
s[0].fSubRunInfo[0]; | 2290 const GrAtlasTextContext::BitmapTextBlob::Run::SubRunInfo& info = blob->fRun
s[0].fSubRunInfo[0]; |
| 2291 return gTextContext->createBatch(blob, info, textLen, 0, 0, color, transX, t
ransY, skPaint); | 2291 return gTextContext->createBatch(blob, info, textLen, 0, 0, color, transX, t
ransY, skPaint); |
| 2292 } | 2292 } |
| 2293 | 2293 |
| 2294 #endif | 2294 #endif |
| OLD | NEW |