| 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 "GrDrawTarget.h" | 10 #include "GrDrawTarget.h" |
| 11 #include "GrGpu.h" | |
| 12 #include "GrPath.h" | 11 #include "GrPath.h" |
| 13 #include "GrPathRange.h" | 12 #include "GrPathRange.h" |
| 14 #include "GrResourceProvider.h" | 13 #include "GrResourceProvider.h" |
| 15 #include "SkAutoKern.h" | 14 #include "SkAutoKern.h" |
| 16 #include "SkDraw.h" | 15 #include "SkDraw.h" |
| 17 #include "SkDrawProcs.h" | 16 #include "SkDrawProcs.h" |
| 18 #include "SkGlyphCache.h" | 17 #include "SkGlyphCache.h" |
| 19 #include "SkGpuDevice.h" | 18 #include "SkGpuDevice.h" |
| 20 #include "SkPath.h" | 19 #include "SkPath.h" |
| 21 #include "SkTextMapStateProc.h" | 20 #include "SkTextMapStateProc.h" |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 reinterpret_cast<uint32_t&>(builder[1]) = typeface ? typeface->uniqueID() :
0; | 231 reinterpret_cast<uint32_t&>(builder[1]) = typeface ? typeface->uniqueID() :
0; |
| 233 if (strokeDataCount > 0) { | 232 if (strokeDataCount > 0) { |
| 234 stroke.asUniqueKeyFragment(&builder[2]); | 233 stroke.asUniqueKeyFragment(&builder[2]); |
| 235 } | 234 } |
| 236 builder.finish(); | 235 builder.finish(); |
| 237 | 236 |
| 238 SkAutoTUnref<GrPathRange> glyphs( | 237 SkAutoTUnref<GrPathRange> glyphs( |
| 239 static_cast<GrPathRange*>( | 238 static_cast<GrPathRange*>( |
| 240 ctx->resourceProvider()->findAndRefResourceByUniqueKey(glyphKey))); | 239 ctx->resourceProvider()->findAndRefResourceByUniqueKey(glyphKey))); |
| 241 if (NULL == glyphs) { | 240 if (NULL == glyphs) { |
| 242 glyphs.reset(ctx->getGpu()->pathRendering()->createGlyphs(typeface, desc
, stroke)); | 241 glyphs.reset(ctx->resourceProvider()->createGlyphs(typeface, desc, strok
e)); |
| 243 ctx->resourceProvider()->assignUniqueKeyToResource(glyphKey, glyphs); | 242 ctx->resourceProvider()->assignUniqueKeyToResource(glyphKey, glyphs); |
| 244 } else { | 243 } else { |
| 245 SkASSERT(NULL == desc || glyphs->isEqualTo(*desc)); | 244 SkASSERT(NULL == desc || glyphs->isEqualTo(*desc)); |
| 246 } | 245 } |
| 247 | 246 |
| 248 return glyphs.detach(); | 247 return glyphs.detach(); |
| 249 } | 248 } |
| 250 | 249 |
| 251 void GrStencilAndCoverTextContext::init(GrRenderTarget* rt, | 250 void GrStencilAndCoverTextContext::init(GrRenderTarget* rt, |
| 252 const GrClip& clip, | 251 const GrClip& clip, |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 479 | 478 |
| 480 SkGlyphCache::AttachCache(fGlyphCache); | 479 SkGlyphCache::AttachCache(fGlyphCache); |
| 481 fGlyphCache = NULL; | 480 fGlyphCache = NULL; |
| 482 | 481 |
| 483 fPipelineBuilder.stencil()->setDisabled(); | 482 fPipelineBuilder.stencil()->setDisabled(); |
| 484 fStateRestore.set(NULL); | 483 fStateRestore.set(NULL); |
| 485 fViewMatrix = fContextInitialMatrix; | 484 fViewMatrix = fContextInitialMatrix; |
| 486 GrTextContext::finish(); | 485 GrTextContext::finish(); |
| 487 } | 486 } |
| 488 | 487 |
| OLD | NEW |