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

Side by Side Diff: src/gpu/GrGpuResourceCacheAccess.h

Issue 1734043002: Revert of Move Budgeted enum out of SkSurface, use in GrTextureProvider (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 10 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/GrGpuResource.cpp ('k') | src/gpu/GrGpuResourcePriv.h » ('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 /* 2 /*
3 * Copyright 2014 Google Inc. 3 * Copyright 2014 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #ifndef GrGpuResourceCacheAccess_DEFINED 9 #ifndef GrGpuResourceCacheAccess_DEFINED
10 #define GrGpuResourceCacheAccess_DEFINED 10 #define GrGpuResourceCacheAccess_DEFINED
11 11
12 #include "GrGpuResource.h" 12 #include "GrGpuResource.h"
13 #include "GrGpuResourcePriv.h" 13 #include "GrGpuResourcePriv.h"
14 14
15 namespace skiatest { 15 namespace skiatest {
16 class Reporter; 16 class Reporter;
17 } 17 }
18 18
19 /** 19 /**
20 * This class allows GrResourceCache increased privileged access to GrGpuResourc e objects. 20 * This class allows GrResourceCache increased privileged access to GrGpuResourc e objects.
21 */ 21 */
22 class GrGpuResource::CacheAccess { 22 class GrGpuResource::CacheAccess {
23 private: 23 private:
24 /** 24 /**
25 * Is the resource currently cached as scratch? This means it is cached, has a valid scratch 25 * Is the resource currently cached as scratch? This means it is cached, has a valid scratch
26 * key, and does not have a unique key. 26 * key, and does not have a unique key.
27 */ 27 */
28 bool isScratch() const { 28 bool isScratch() const {
29 return !fResource->getUniqueKey().isValid() && fResource->fScratchKey.is Valid() && 29 return !fResource->getUniqueKey().isValid() && fResource->fScratchKey.is Valid() &&
30 SkBudgeted::kYes == fResource->resourcePriv().isBudgeted(); 30 fResource->resourcePriv().isBudgeted();
31 } 31 }
32 32
33 /** 33 /**
34 * Is the resource object wrapping an externally allocated GPU resource? 34 * Is the resource object wrapping an externally allocated GPU resource?
35 */ 35 */
36 bool isExternal() const { return fResource->isExternal(); } 36 bool isExternal() const { return fResource->isExternal(); }
37 37
38 /** 38 /**
39 * Is the resource object wrapping an externally allocated GPU resource that Skia has not taken 39 * Is the resource object wrapping an externally allocated GPU resource that Skia has not taken
40 * ownership of. 40 * ownership of.
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 friend void test_unbudgeted_to_scratch(skiatest::Reporter* reporter); // for unit testing 93 friend void test_unbudgeted_to_scratch(skiatest::Reporter* reporter); // for unit testing
94 }; 94 };
95 95
96 inline GrGpuResource::CacheAccess GrGpuResource::cacheAccess() { return CacheAcc ess(this); } 96 inline GrGpuResource::CacheAccess GrGpuResource::cacheAccess() { return CacheAcc ess(this); }
97 97
98 inline const GrGpuResource::CacheAccess GrGpuResource::cacheAccess() const { 98 inline const GrGpuResource::CacheAccess GrGpuResource::cacheAccess() const {
99 return CacheAccess(const_cast<GrGpuResource*>(this)); 99 return CacheAccess(const_cast<GrGpuResource*>(this));
100 } 100 }
101 101
102 #endif 102 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrGpuResource.cpp ('k') | src/gpu/GrGpuResourcePriv.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698