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

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

Issue 846303002: Make uncached textures uncached from the get go. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add comment Created 5 years, 11 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/GrPathRange.h ('k') | src/gpu/GrResourceCache2.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 "GrPathRange.h" 8 #include "GrPathRange.h"
9 #include "SkPath.h" 9 #include "SkPath.h"
10 10
11 enum { 11 enum {
12 kPathsPerGroup = 16 // Paths get tracked in groups of 16 for lazy loading. 12 kPathsPerGroup = 16 // Paths get tracked in groups of 16 for lazy loading.
13 }; 13 };
14 14
15 GrPathRange::GrPathRange(GrGpu* gpu, 15 GrPathRange::GrPathRange(GrGpu* gpu,
16 PathGenerator* pathGenerator, 16 PathGenerator* pathGenerator,
17 const SkStrokeRec& stroke) 17 const SkStrokeRec& stroke)
18 : INHERITED(gpu, kIsWrapped), 18 : INHERITED(gpu, kCached_LifeCycle),
19 fPathGenerator(SkRef(pathGenerator)), 19 fPathGenerator(SkRef(pathGenerator)),
20 fNumPaths(fPathGenerator->getNumPaths()), 20 fNumPaths(fPathGenerator->getNumPaths()),
21 fStroke(stroke) { 21 fStroke(stroke) {
22 const int numGroups = (fNumPaths + kPathsPerGroup - 1) / kPathsPerGroup; 22 const int numGroups = (fNumPaths + kPathsPerGroup - 1) / kPathsPerGroup;
23 fGeneratedPaths.reset((numGroups + 7) / 8); // 1 bit per path group. 23 fGeneratedPaths.reset((numGroups + 7) / 8); // 1 bit per path group.
24 memset(&fGeneratedPaths.front(), 0, fGeneratedPaths.count()); 24 memset(&fGeneratedPaths.front(), 0, fGeneratedPaths.count());
25 } 25 }
26 26
27 GrPathRange::GrPathRange(GrGpu* gpu, 27 GrPathRange::GrPathRange(GrGpu* gpu,
28 int numPaths, 28 int numPaths,
29 const SkStrokeRec& stroke) 29 const SkStrokeRec& stroke)
30 : INHERITED(gpu, kIsWrapped), 30 : INHERITED(gpu, kCached_LifeCycle),
31 fNumPaths(numPaths), 31 fNumPaths(numPaths),
32 fStroke(stroke) { 32 fStroke(stroke) {
33 } 33 }
34 34
35 void GrPathRange::willDrawPaths(const void* indices, PathIndexType indexType, in t count) const { 35 void GrPathRange::willDrawPaths(const void* indices, PathIndexType indexType, in t count) const {
36 if (!fPathGenerator) { 36 if (!fPathGenerator) {
37 return; 37 return;
38 } 38 }
39 39
40 switch (indexType) { 40 switch (indexType) {
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 73
74 fGeneratedPaths[groupByte] |= groupBit; 74 fGeneratedPaths[groupByte] |= groupBit;
75 didLoadPaths = true; 75 didLoadPaths = true;
76 } 76 }
77 } 77 }
78 78
79 if (didLoadPaths) { 79 if (didLoadPaths) {
80 this->didChangeGpuMemorySize(); 80 this->didChangeGpuMemorySize();
81 } 81 }
82 } 82 }
OLDNEW
« no previous file with comments | « src/gpu/GrPathRange.h ('k') | src/gpu/GrResourceCache2.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698