aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrGpuResourceCacheAccess.h
Commit message (Collapse)AuthorAge
* Revert "Revert "Add a new GrResourceCache purging mechanism for purging ↵Gravatar Brian Salomon2017-03-22
| | | | | | | | | | | unused resources."" This reverts commit 20c322ef0cd04cf8e2592879d05d9f4e6cb19596. Change-Id: I6df9a8594484837672308dc2c21c7c29b76ffa2c Reviewed-on: https://skia-review.googlesource.com/10013 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
* Revert "Add a new GrResourceCache purging mechanism for purging unused ↵Gravatar Brian Salomon2017-03-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | resources." This reverts commit fbb56ce83fc717b7c6722324bbccd1ae73c350a4. Reason for revert: Chrome's ancient libstdc++ doesn't like use of steady_clock Original change's description: > Add a new GrResourceCache purging mechanism for purging unused resources. > > The client may call GrContext::purgeResourceNotUsedSince() with a stead_clock::time_point and all resources that have been purgeable since before that time point are purged. > > This is intended to replace the "max unused flushes" purging mechanism once Chrome adopts it. > > Change-Id: I28881dd2959cc01c0acca81b2d6001ee5626439d > Reviewed-on: https://skia-review.googlesource.com/8920 > Commit-Queue: Brian Salomon <bsalomon@google.com> > Reviewed-by: Robert Phillips <robertphillips@google.com> > Reviewed-by: Eric Karl <ericrk@google.com> > TBR=bsalomon@google.com,robertphillips@google.com,ericrk@google.com,reviews@skia.org,ericrk@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Change-Id: I3baa3b2e80302315b757d4d625732459e13795d4 Reviewed-on: https://skia-review.googlesource.com/10004 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Add a new GrResourceCache purging mechanism for purging unused resources.Gravatar Brian Salomon2017-03-22
| | | | | | | | | | | | The client may call GrContext::purgeResourceNotUsedSince() with a stead_clock::time_point and all resources that have been purgeable since before that time point are purged. This is intended to replace the "max unused flushes" purging mechanism once Chrome adopts it. Change-Id: I28881dd2959cc01c0acca81b2d6001ee5626439d Reviewed-on: https://skia-review.googlesource.com/8920 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com> Reviewed-by: Eric Karl <ericrk@google.com>
* Change implementation of flush-count based GrGpuResource purgingGravatar bsalomon2016-09-22
| | | | | | | Change default to approx 30seconds (given some API usage assumptions) GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2361093002 Review-Url: https://codereview.chromium.org/2361093002
* Refactor to separate backend object lifecycle and GpuResource budget decisionGravatar kkinnunen2016-04-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactor GrGpuResource to contain two different pieces of state: a) instance is budgeted or not budgeted b) instance references wrapped backend objects or not The "object lifecycle" was also attached to backend object handles (ids), which made the code a bit unclear. Backend objects would be associated with GrGpuResource::LifeCycle, even though GrGpuResource::LifeCycle refers to the GpuResource, and individual backend objects in one GpuResource might be governed with different "lifecycle". Mark the budgeted/not budgeted with SkBudgeted::kYes, SkBudgeted::kNo. This was previously GrGpuResource::kCached_LifeCycle, GrGpuResource::kUncached_LifeCycle. Mark the "references wrapped object" with boolean. This was previously GrGpuResource::kBorrowed_LifeCycle, GrGpuResource::kAdopted_LifeCycle for GrGpuResource. Associate the backend object ownership status with GrBackendObjectOwnership for the backend object handles. The resource type leaf constuctors, such has GrGLTexture or GrGLTextureRenderTarget take "budgeted" parameter. This parameter is passed to GrGpuResource::registerWithCache(). The resource type intermediary constructors, such as GrGLTexture constructors for class GrGLTextureRenderTarget do not take "budgeted" parameters, intermediary construtors do not call registerWithCache. Removes the need for tagging GrGpuResource -derived subclass constructors with "Derived" parameter. Makes instances that wrap backend objects be registered with a new function GrGpuResource::registerWithCacheWrapped(). Removes "budgeted" parameter from classes such as StencilAttahment, as they are always cached and never wrap any external backend objects. Removes the use of concept "external" from the member function names. The API refers to the objects as "wrapped", so make all related functions use the term consistently. No change in functionality. Resources referencing wrapped objects are always inserted to the cache with budget decision kNo. BUG=594928 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1862043002 Review URL: https://codereview.chromium.org/1862043002
* Style bikeshed - remove extraneous whitespaceGravatar halcanary2016-03-29
| | | | | | GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1842753002 Review URL: https://codereview.chromium.org/1842753002
* When a surface is backed by an external render target force a copy on image snapGravatar bsalomon2016-02-26
| | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1694943002 Review URL: https://codereview.chromium.org/1694943002
* Move Budgeted enum out of SkSurface, use in GrTextureProviderGravatar bsalomon2016-02-25
| | | | | | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1728093005 DOCS_PREVIEW= https://skia.org/?cl=1728093005 Committed: https://skia.googlesource.com/skia/+/57599fe6c0336feaeeeb9b1996e77b70219b483c CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Ubuntu-GCC-x86_64-Release-CMake-Trybot,Build-Mac-Clang-x86_64-Release-CMake-Trybot Review URL: https://codereview.chromium.org/1728093005
* Revert of Move Budgeted enum out of SkSurface, use in GrTextureProvider ↵Gravatar bsalomon2016-02-25
| | | | | | | | | | | | | | | | | | | | | | | | | (patchset #6 id:100001 of https://codereview.chromium.org/1728093005/ ) Reason for revert: Need workaround for chrome to build Original issue's description: > Move Budgeted enum out of SkSurface, use in GrTextureProvider > > BUG=skia: > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1728093005 > DOCS_PREVIEW= https://skia.org/?cl=1728093005 > > Committed: https://skia.googlesource.com/skia/+/57599fe6c0336feaeeeb9b1996e77b70219b483c TBR=reed@google.com # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/1734043002
* Move Budgeted enum out of SkSurface, use in GrTextureProviderGravatar bsalomon2016-02-25
| | | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1728093005 DOCS_PREVIEW= https://skia.org/?cl=1728093005 Review URL: https://codereview.chromium.org/1728093005
* Style Change: SkNEW->new; SkDELETE->deleteGravatar halcanary2015-08-26
| | | | | | DOCS_PREVIEW= https://skia.org/?cl=1316123003 Review URL: https://codereview.chromium.org/1316123003
* Add support for creating texture backed images where Skia will delete the ↵Gravatar bsalomon2015-06-18
| | | | | | texture. Review URL: https://codereview.chromium.org/1187523005
* Allow resources' unique keys to be changed.Gravatar bsalomon2015-02-19
| | | | Review URL: https://codereview.chromium.org/938943002
* Rename GrContentKey to GrUniqueKeyGravatar bsalomon2015-02-19
| | | | Review URL: https://codereview.chromium.org/940463006
* Make GrResourceCache use a priority queue of purgeable resources.Gravatar bsalomon2015-02-17
| | | | Review URL: https://codereview.chromium.org/921323002
* Split out methods in GrGpuResource::CacheAccess that can be called outside ↵Gravatar bsalomon2015-02-13
| | | | | | of the cache. Review URL: https://codereview.chromium.org/923143002
* Reimplement gpu message bus for invalidated bitmap gen IDsGravatar bsalomon2015-02-06
| | | | Review URL: https://codereview.chromium.org/902873002
* make getContentKey() available in GrGpuResource public interfaceGravatar bsalomon2015-02-02
| | | | | | | | TBR=robertphillips@google.com Committed: https://skia.googlesource.com/skia/+/85ed2db092e75db41b711b9116a8d5b465fc2b0c Review URL: https://codereview.chromium.org/886313005
* Revert of make getContentKey() available in GrGpuResource public interface ↵Gravatar stephana2015-02-02
| | | | | | | | | | | | | | | | | | | | | | | (patchset #2 id:20001 of https://codereview.chromium.org/886313005/) Reason for revert: This causes in one case the linker and in the other the compiler to segfault. On Test-Ubuntu12-ShuttleA-GTX660-x86_64-Debug/Release Original issue's description: > make getContentKey() available in GrGpuResource public interface > > TBR=robertphillips@google.com > > Committed: https://skia.googlesource.com/skia/+/85ed2db092e75db41b711b9116a8d5b465fc2b0c TBR=robertphillips@google.com,bsalomon@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/864343005
* make getContentKey() available in GrGpuResource public interfaceGravatar bsalomon2015-02-02
| | | | | | TBR=robertphillips@google.com Review URL: https://codereview.chromium.org/886313005
* Fix the speeling of "purgeable" in Gr codeGravatar bsalomon2015-01-23
| | | | | | TBR=robertphillips@google.com Review URL: https://codereview.chromium.org/874693002
* Allow unbudgeted resources to be recycled by the cache as scratch.Gravatar bsalomon2015-01-23
| | | | Review URL: https://codereview.chromium.org/870743002
* Add specialized content key class for resources.Gravatar bsalomon2015-01-23
| | | | Review URL: https://codereview.chromium.org/858123002
* Require budget decision when creating a RenderTarget SkSurface.Gravatar bsalomon2015-01-16
| | | | | | | | | Restructure SkGpuDevice creation: *SkSurfaceProps are optional. *Use SkSurfaceProps to communicate DF text rather than a flag. *Tell SkGpuDevice::Create whether RT comes from cache or not. Review URL: https://codereview.chromium.org/848903004
* Make uncached textures uncached from the get go.Gravatar bsalomon2015-01-14
| | | | | | | | This avoids the problem of a newly created uncached texture causing a purge of cached resources. BUG=chromium:445885 Review URL: https://codereview.chromium.org/846303002
* Add a simpler key type for scratch resource keys.Gravatar bsalomon2014-12-30
| | | | | | BUG=skia:2889 Review URL: https://codereview.chromium.org/815833004
* Use scratch keys for stencil buffers.Gravatar bsalomon2014-11-25
| | | | | | | | BUG=skia:2889 Committed: https://skia.googlesource.com/skia/+/91175f19664a62851da4ca4e0984a7c7c45b258f Review URL: https://codereview.chromium.org/747043004
* Allow GPU resources to not be counted against the cache budget.Gravatar bsalomon2014-11-17
| | | | | | BUG=skia:2889 Review URL: https://codereview.chromium.org/721353002
* Correct accounting for wrapped resourcesGravatar bsalomon2014-11-17
| | | | | | BUG=skia:2889 Review URL: https://codereview.chromium.org/720033004
* Make GrResourceCache2 responsible for calling release, abandon, and ~.Gravatar bsalomon2014-11-14
| | | | | | | | | | BUG=skia:2889 TBR=robertphillips@google.com NOTRY=true Review URL: https://codereview.chromium.org/729683002
* Replace GrResourceCache with GrResourceCache2.Gravatar bsalomon2014-11-14
| | | | | | | | | | BUG=skia:2889 Committed: https://skia.googlesource.com/skia/+/66a450f21a3da174b7eed89a1d5fc8591e8b6ee6 Committed: https://skia.googlesource.com/skia/+/407aa584d183c1bf314f5defd1cf0202e8a96c89 Review URL: https://codereview.chromium.org/716143004
* Revert of Replace GrResourceCache with GrResourceCache2. (patchset #7 ↵Gravatar bsalomon2014-11-14
| | | | | | | | | | | | | | | | | | | | | | | id:120001 of https://codereview.chromium.org/716143004/) Reason for revert: broken again Original issue's description: > Replace GrResourceCache with GrResourceCache2. > > BUG=skia:2889 > > Committed: https://skia.googlesource.com/skia/+/66a450f21a3da174b7eed89a1d5fc8591e8b6ee6 > > Committed: https://skia.googlesource.com/skia/+/407aa584d183c1bf314f5defd1cf0202e8a96c89 TBR=robertphillips@google.com NOTREECHECKS=true NOTRY=true BUG=skia:2889 Review URL: https://codereview.chromium.org/726913002
* Replace GrResourceCache with GrResourceCache2.Gravatar bsalomon2014-11-14
| | | | | | | | BUG=skia:2889 Committed: https://skia.googlesource.com/skia/+/66a450f21a3da174b7eed89a1d5fc8591e8b6ee6 Review URL: https://codereview.chromium.org/716143004
* Revert of Replace GrResourceCache with GrResourceCache2. (patchset #6 ↵Gravatar bsalomon2014-11-13
| | | | | | | | | | | | | | | | | | | | | id:100001 of https://codereview.chromium.org/716143004/) Reason for revert: Breaking stuff Original issue's description: > Replace GrResourceCache with GrResourceCache2. > > BUG=skia:2889 > > Committed: https://skia.googlesource.com/skia/+/66a450f21a3da174b7eed89a1d5fc8591e8b6ee6 TBR=robertphillips@google.com NOTREECHECKS=true NOTRY=true BUG=skia:2889 Review URL: https://codereview.chromium.org/715333003
* Replace GrResourceCache with GrResourceCache2.Gravatar bsalomon2014-11-13
| | | | | | BUG=skia:2889 Review URL: https://codereview.chromium.org/716143004
* Add GrGpuResource::CacheAccessGravatar bsalomon2014-11-11
Internal only helper class for manipulating and accessing cache keys. BUG=skia:2889 Review URL: https://codereview.chromium.org/703303003