OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 "GrStencilAndCoverTextContext.h" | 8 #include "GrStencilAndCoverTextContext.h" |
9 #include "GrAtlasTextContext.h" | 9 #include "GrAtlasTextContext.h" |
10 #include "GrDrawContext.h" | 10 #include "GrDrawContext.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 const SkSurfaceProps&
surfaceProps) | 26 const SkSurfaceProps&
surfaceProps) |
27 : GrTextContext(context, drawContext, surfaceProps) | 27 : GrTextContext(context, drawContext, surfaceProps) |
28 , fStroke(SkStrokeRec::kFill_InitStyle) | 28 , fStroke(SkStrokeRec::kFill_InitStyle) |
29 , fQueuedGlyphCount(0) | 29 , fQueuedGlyphCount(0) |
30 , fFallbackGlyphsIdx(kGlyphBufferSize) { | 30 , fFallbackGlyphsIdx(kGlyphBufferSize) { |
31 } | 31 } |
32 | 32 |
33 GrStencilAndCoverTextContext* | 33 GrStencilAndCoverTextContext* |
34 GrStencilAndCoverTextContext::Create(GrContext* context, GrDrawContext* drawCont
ext, | 34 GrStencilAndCoverTextContext::Create(GrContext* context, GrDrawContext* drawCont
ext, |
35 const SkSurfaceProps& surfaceProps) { | 35 const SkSurfaceProps& surfaceProps) { |
36 GrStencilAndCoverTextContext* textContext = SkNEW_ARGS(GrStencilAndCoverText
Context, | 36 GrStencilAndCoverTextContext* textContext = |
37 (context, drawContext
, surfaceProps)); | 37 new GrStencilAndCoverTextContext(context, drawContext, surfaceProps)
; |
38 textContext->fFallbackTextContext = GrAtlasTextContext::Create(context, draw
Context, surfaceProps); | 38 textContext->fFallbackTextContext = GrAtlasTextContext::Create(context, draw
Context, surfaceProps); |
39 | 39 |
40 return textContext; | 40 return textContext; |
41 } | 41 } |
42 | 42 |
43 GrStencilAndCoverTextContext::~GrStencilAndCoverTextContext() { | 43 GrStencilAndCoverTextContext::~GrStencilAndCoverTextContext() { |
44 } | 44 } |
45 | 45 |
46 bool GrStencilAndCoverTextContext::canDraw(const GrRenderTarget* rt, | 46 bool GrStencilAndCoverTextContext::canDraw(const GrRenderTarget* rt, |
47 const GrClip& clip, | 47 const GrClip& clip, |
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
487 | 487 |
488 fGlyphs->unref(); | 488 fGlyphs->unref(); |
489 fGlyphs = NULL; | 489 fGlyphs = NULL; |
490 | 490 |
491 SkGlyphCache::AttachCache(fGlyphCache); | 491 SkGlyphCache::AttachCache(fGlyphCache); |
492 fGlyphCache = NULL; | 492 fGlyphCache = NULL; |
493 | 493 |
494 fViewMatrix = fContextInitialMatrix; | 494 fViewMatrix = fContextInitialMatrix; |
495 } | 495 } |
496 | 496 |
OLD | NEW |