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

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

Issue 488463004: Revert of Make GrGpuResources register with GrResourceCache2 after fully constructed. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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/GrResourceCache2.cpp ('k') | src/gpu/gl/GrGLIndexBuffer.cpp » ('j') | 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 25 matching lines...) Expand all
36 GrResourceKey resourceKey(GrCacheID(gGlyphPathRangeDomain, key), 36 GrResourceKey resourceKey(GrCacheID(gGlyphPathRangeDomain, key),
37 GrPathRange::resourceType(), 0); 37 GrPathRange::resourceType(), 0);
38 SkAutoTUnref<GlyphPathRange> glyphs( 38 SkAutoTUnref<GlyphPathRange> glyphs(
39 static_cast<GlyphPathRange*>(context->findAndRefCachedResource(resou rceKey))); 39 static_cast<GlyphPathRange*>(context->findAndRefCachedResource(resou rceKey)));
40 40
41 if (NULL == glyphs || 41 if (NULL == glyphs ||
42 !glyphs->fDesc->equals(cache->getDescriptor() /*checksum collision*/ )) { 42 !glyphs->fDesc->equals(cache->getDescriptor() /*checksum collision*/ )) {
43 glyphs.reset(SkNEW_ARGS(GlyphPathRange, (context, cache->getDescript or(), stroke))); 43 glyphs.reset(SkNEW_ARGS(GlyphPathRange, (context, cache->getDescript or(), stroke)));
44 context->addResourceToCache(resourceKey, glyphs); 44 context->addResourceToCache(resourceKey, glyphs);
45 } 45 }
46 glyphs->registerWithCache();
47 46
48 return glyphs.detach(); 47 return glyphs.detach();
49 } 48 }
50 49
51 const GrPathRange* pathRange() const { return fPathRange.get(); } 50 const GrPathRange* pathRange() const { return fPathRange.get(); }
52 51
53 void preloadGlyph(uint16_t glyphID, SkGlyphCache* cache) { 52 void preloadGlyph(uint16_t glyphID, SkGlyphCache* cache) {
54 const uint16_t groupIndex = glyphID / kGlyphGroupSize; 53 const uint16_t groupIndex = glyphID / kGlyphGroupSize;
55 const uint16_t groupByte = groupIndex >> 3; 54 const uint16_t groupByte = groupIndex >> 3;
56 const uint8_t groupBit = 1 << (groupIndex & 7); 55 const uint8_t groupBit = 1 << (groupIndex & 7);
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after
444 SkSafeUnref(fGlyphs); 443 SkSafeUnref(fGlyphs);
445 fGlyphs = NULL; 444 fGlyphs = NULL;
446 fGlyphCache = NULL; 445 fGlyphCache = NULL;
447 446
448 fDrawTarget->drawState()->stencil()->setDisabled(); 447 fDrawTarget->drawState()->stencil()->setDisabled();
449 fStateRestore.set(NULL); 448 fStateRestore.set(NULL);
450 fContext->setMatrix(fContextInitialMatrix); 449 fContext->setMatrix(fContextInitialMatrix);
451 GrTextContext::finish(); 450 GrTextContext::finish();
452 } 451 }
453 452
OLDNEW
« no previous file with comments | « src/gpu/GrResourceCache2.cpp ('k') | src/gpu/gl/GrGLIndexBuffer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698