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

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

Issue 1694943002: When a surface is backed by an external render target force a copy on image snap (Closed) Base URL: https://skia.googlesource.com/skia.git@imgcopy
Patch Set: test git config branch.nollvm.skip-deps-uploads True Created 4 years, 9 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/GrGpuResourceCacheAccess.h ('k') | src/gpu/GrResourceCache.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 2015 Google Inc. 3 * Copyright 2015 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 GrGpuResourcePriv_DEFINED 9 #ifndef GrGpuResourcePriv_DEFINED
10 #define GrGpuResourcePriv_DEFINED 10 #define GrGpuResourcePriv_DEFINED
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 43
44 /** 44 /**
45 * Does the resource count against the resource budget? 45 * Does the resource count against the resource budget?
46 */ 46 */
47 SkBudgeted isBudgeted() const { 47 SkBudgeted isBudgeted() const {
48 bool ret = GrGpuResource::kCached_LifeCycle == fResource->fLifeCycle; 48 bool ret = GrGpuResource::kCached_LifeCycle == fResource->fLifeCycle;
49 SkASSERT(ret || !fResource->getUniqueKey().isValid()); 49 SkASSERT(ret || !fResource->getUniqueKey().isValid());
50 return SkBudgeted(ret); 50 return SkBudgeted(ret);
51 } 51 }
52 52
53 /** 53 /**
54 * Is the resource object wrapping an externally allocated GPU resource?
55 */
56 bool isExternal() const { return fResource->isExternal(); }
57
58 /**
54 * If this resource can be used as a scratch resource this returns a valid s cratch key. 59 * If this resource can be used as a scratch resource this returns a valid s cratch key.
55 * Otherwise it returns a key for which isNullScratch is true. The resource may currently be 60 * Otherwise it returns a key for which isNullScratch is true. The resource may currently be
56 * used as a uniquely keyed resource rather than scratch. Check isScratch(). 61 * used as a uniquely keyed resource rather than scratch. Check isScratch().
57 */ 62 */
58 const GrScratchKey& getScratchKey() const { return fResource->fScratchKey; } 63 const GrScratchKey& getScratchKey() const { return fResource->fScratchKey; }
59 64
60 /** 65 /**
61 * If the resource has a scratch key, the key will be removed. Since scratch keys are installed 66 * If the resource has a scratch key, the key will be removed. Since scratch keys are installed
62 * at resource creation time, this means the resource will never again be us ed as scratch. 67 * at resource creation time, this means the resource will never again be us ed as scratch.
63 */ 68 */
(...skipping 13 matching lines...) Expand all
77 friend class GrGpuResource; // to construct/copy this type. 82 friend class GrGpuResource; // to construct/copy this type.
78 }; 83 };
79 84
80 inline GrGpuResource::ResourcePriv GrGpuResource::resourcePriv() { return Resour cePriv(this); } 85 inline GrGpuResource::ResourcePriv GrGpuResource::resourcePriv() { return Resour cePriv(this); }
81 86
82 inline const GrGpuResource::ResourcePriv GrGpuResource::resourcePriv() const { 87 inline const GrGpuResource::ResourcePriv GrGpuResource::resourcePriv() const {
83 return ResourcePriv(const_cast<GrGpuResource*>(this)); 88 return ResourcePriv(const_cast<GrGpuResource*>(this));
84 } 89 }
85 90
86 #endif 91 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrGpuResourceCacheAccess.h ('k') | src/gpu/GrResourceCache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698