| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 | 7 |
| 8 #include "GrBitmapTextContext.h" | 8 #include "GrBitmapTextContext.h" |
| 9 #include "GrAtlas.h" | 9 #include "GrAtlas.h" |
| 10 #include "GrDrawTarget.h" | 10 #include "GrDrawTarget.h" |
| 11 #include "GrFontScaler.h" | 11 #include "GrFontScaler.h" |
| 12 #include "GrIndexBuffer.h" | 12 #include "GrIndexBuffer.h" |
| 13 #include "GrTextStrike.h" | 13 #include "GrTextStrike.h" |
| 14 #include "GrTextStrike_impl.h" | 14 #include "GrTextStrike_impl.h" |
| 15 #include "SkColorPriv.h" | 15 #include "SkColorPriv.h" |
| 16 #include "SkPath.h" | 16 #include "SkPath.h" |
| 17 #include "SkRTConf.h" | 17 #include "SkRTConf.h" |
| 18 #include "SkStrokeRec.h" | 18 #include "SkStrokeRec.h" |
| 19 #include "effects/GrCustomCoordsTextureEffect.h" | 19 #include "effects/GrCustomCoordsTextureEffect.h" |
| 20 | 20 |
| 21 #include "SkAutoKern.h" | 21 #include "SkAutoKern.h" |
| 22 #include "SkDraw.h" |
| 22 #include "SkGlyphCache.h" | 23 #include "SkGlyphCache.h" |
| 23 #include "SkGpuDevice.h" | 24 #include "SkGpuDevice.h" |
| 24 #include "SkGr.h" | 25 #include "SkGr.h" |
| 25 | 26 |
| 26 static const int kGlyphCoordsAttributeIndex = 1; | 27 static const int kGlyphCoordsAttributeIndex = 1; |
| 27 | 28 |
| 28 SK_CONF_DECLARE(bool, c_DumpFontCache, "gpu.dumpFontCache", false, | 29 SK_CONF_DECLARE(bool, c_DumpFontCache, "gpu.dumpFontCache", false, |
| 29 "Dump the contents of the font cache before every purge."); | 30 "Dump the contents of the font cache before every purge."); |
| 30 | 31 |
| 32 bool GrBitmapTextContext::CanDraw(const SkPaint& paint, const SkMatrix& ctm) { |
| 33 return !SkDraw::ShouldDrawTextAsPaths(paint, ctm); |
| 34 } |
| 35 |
| 31 GrBitmapTextContext::GrBitmapTextContext(GrContext* context, | 36 GrBitmapTextContext::GrBitmapTextContext(GrContext* context, |
| 32 const GrPaint& grPaint, | 37 const GrPaint& grPaint, |
| 33 const SkPaint& skPaint, | 38 const SkPaint& skPaint, |
| 34 const SkDeviceProperties& properties) | 39 const SkDeviceProperties& properties) |
| 35 : GrTextContext(context, grPaint, skPaint
, properties) { | 40 : GrTextContext(context, grPaint, skPaint
, properties) { |
| 36 fStrike = NULL; | 41 fStrike = NULL; |
| 37 | 42 |
| 38 fCurrTexture = NULL; | 43 fCurrTexture = NULL; |
| 39 fCurrVertex = 0; | 44 fCurrVertex = 0; |
| 40 | 45 |
| (...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 590 SkFixedToFloat(vx + width), | 595 SkFixedToFloat(vx + width), |
| 591 SkFixedToFloat(vy + height), | 596 SkFixedToFloat(vy + height), |
| 592 2 * sizeof(SkPoint)); | 597 2 * sizeof(SkPoint)); |
| 593 fVertices[2*fCurrVertex+1].setRectFan(SkFixedToFloat(texture->normalizeFixed
X(tx)), | 598 fVertices[2*fCurrVertex+1].setRectFan(SkFixedToFloat(texture->normalizeFixed
X(tx)), |
| 594 SkFixedToFloat(texture->normalizeFixed
Y(ty)), | 599 SkFixedToFloat(texture->normalizeFixed
Y(ty)), |
| 595 SkFixedToFloat(texture->normalizeFixed
X(tx + width)), | 600 SkFixedToFloat(texture->normalizeFixed
X(tx + width)), |
| 596 SkFixedToFloat(texture->normalizeFixed
Y(ty + height)), | 601 SkFixedToFloat(texture->normalizeFixed
Y(ty + height)), |
| 597 2 * sizeof(SkPoint)); | 602 2 * sizeof(SkPoint)); |
| 598 fCurrVertex += 4; | 603 fCurrVertex += 4; |
| 599 } | 604 } |
| OLD | NEW |