Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(457)

Side by Side Diff: src/gpu/GrStencilAndCoverTextContext.cpp

Issue 578563002: Remove createPath* from GrGpu and GrContext (Closed) Base URL: https://skia.googlesource.com/skia.git@upload_glyphmemorypath
Patch Set: Simple quick change Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/gpu/GrStencilAndCoverPathRenderer.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "GrDrawTarget.h" 9 #include "GrDrawTarget.h"
10 #include "GrGpu.h" 10 #include "GrGpu.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 // GrGpuResource overrides 79 // GrGpuResource overrides
80 virtual size_t gpuMemorySize() const SK_OVERRIDE { return fPathRange->gpuMem orySize(); } 80 virtual size_t gpuMemorySize() const SK_OVERRIDE { return fPathRange->gpuMem orySize(); }
81 81
82 private: 82 private:
83 GlyphPathRange(GrContext* context, const SkDescriptor& desc, const SkStrokeR ec& stroke) 83 GlyphPathRange(GrContext* context, const SkDescriptor& desc, const SkStrokeR ec& stroke)
84 : INHERITED(context->getGpu(), false) 84 : INHERITED(context->getGpu(), false)
85 , fDesc(desc.copy()) 85 , fDesc(desc.copy())
86 // We reserve a range of kMaxGlyphCount paths because of fallbacks fonts . We 86 // We reserve a range of kMaxGlyphCount paths because of fallbacks fonts . We
87 // can't know exactly how many glyphs we might need without preloading e very 87 // can't know exactly how many glyphs we might need without preloading e very
88 // fallback, which we don't want to do at this point. 88 // fallback, which we don't want to do at this point.
89 , fPathRange(context->getGpu()->createPathRange(kMaxGlyphCount, stroke)) { 89 , fPathRange(context->getGpu()->pathRendering()->createPathRange(kMaxGly phCount, stroke)) {
90 memset(fLoadedGlyphs, 0, sizeof(fLoadedGlyphs)); 90 memset(fLoadedGlyphs, 0, sizeof(fLoadedGlyphs));
91 } 91 }
92 92
93 ~GlyphPathRange() { 93 ~GlyphPathRange() {
94 this->release(); 94 this->release();
95 SkDescriptor::Free(fDesc); 95 SkDescriptor::Free(fDesc);
96 } 96 }
97 97
98 static const int kMaxGroupCount = (kMaxGlyphCount + (kGlyphGroupSize - 1)) / kGlyphGroupSize; 98 static const int kMaxGroupCount = (kMaxGlyphCount + (kGlyphGroupSize - 1)) / kGlyphGroupSize;
99 SkDescriptor* const fDesc; 99 SkDescriptor* const fDesc;
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
444 SkSafeUnref(fGlyphs); 444 SkSafeUnref(fGlyphs);
445 fGlyphs = NULL; 445 fGlyphs = NULL;
446 fGlyphCache = NULL; 446 fGlyphCache = NULL;
447 447
448 fDrawTarget->drawState()->stencil()->setDisabled(); 448 fDrawTarget->drawState()->stencil()->setDisabled();
449 fStateRestore.set(NULL); 449 fStateRestore.set(NULL);
450 fContext->setMatrix(fContextInitialMatrix); 450 fContext->setMatrix(fContextInitialMatrix);
451 GrTextContext::finish(); 451 GrTextContext::finish();
452 } 452 }
453 453
OLDNEW
« no previous file with comments | « src/gpu/GrStencilAndCoverPathRenderer.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698