aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/ResourceCacheTest.cpp
Commit message (Collapse)AuthorAge
* Turn ContextInfos returned by GrContextFactory into structs.Gravatar bsalomon2016-05-11
| | | | | | GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1966013002 Review-Url: https://codereview.chromium.org/1966013002
* 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
* Make more unit tests run on VulkanGravatar bsalomon2016-04-12
| | | | | | GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1885623002 Review URL: https://codereview.chromium.org/1885623002
* Make existing unit tests only run on GL contextsGravatar bsalomon2016-04-06
| | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1869503002 Review URL: https://codereview.chromium.org/1869503002
* One signature for creating unit tests that run on premade GrContextsGravatar bsalomon2016-04-05
| | | | | | GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1860593002 Review URL: https://codereview.chromium.org/1860593002
* switch surface to sk_spGravatar reed2016-03-23
| | | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1817383002 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/1817383002
* Use std::unique_ptr.Gravatar mtklein2016-03-16
| | | | | | | | | | | | | TBR=reed@google.com Committed: https://skia.googlesource.com/skia/+/20c1e3abfc681771f73eb19fde7284196e028940 Committed: https://skia.googlesource.com/skia/+/3dd9ed37c24611af86f0fe374bd3698b63f09450 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1780933003 Committed: https://skia.googlesource.com/skia/+/2691d76a06e1af6282f8b3a3140cc93361be10c4 Review URL: https://codereview.chromium.org/1780933003
* Revert of Use std::unique_ptr. (patchset #10 id:170001 of ↵Gravatar mtklein2016-03-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/1780933003/ ) Reason for revert: aww jeez, I dropped ps 8... Original issue's description: > Use std::unique_ptr. > > TBR=reed@google.com > > Committed: https://skia.googlesource.com/skia/+/20c1e3abfc681771f73eb19fde7284196e028940 > > Committed: https://skia.googlesource.com/skia/+/3dd9ed37c24611af86f0fe374bd3698b63f09450 > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1780933003 > > Committed: https://skia.googlesource.com/skia/+/2691d76a06e1af6282f8b3a3140cc93361be10c4 TBR=bungeman@google.com,mtklein@chromium.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/1809693002
* Use std::unique_ptr.Gravatar mtklein2016-03-16
| | | | | | | | | | | TBR=reed@google.com Committed: https://skia.googlesource.com/skia/+/20c1e3abfc681771f73eb19fde7284196e028940 Committed: https://skia.googlesource.com/skia/+/3dd9ed37c24611af86f0fe374bd3698b63f09450 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1780933003 Review URL: https://codereview.chromium.org/1780933003
* Revert of Use std::unique_ptr. (patchset #8 id:130001 of ↵Gravatar mtklein2016-03-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/1780933003/ ) Reason for revert: Another Android ambiguity due to implicit bool... frameworks/base/core/jni/android/graphics/Utils.cpp:110:35: error: call of overloaded 'SkMemoryStream(SkAutoTUnref<SkData>&)' is ambiguous return new SkMemoryStream(data); Original issue's description: > Use std::unique_ptr. > > TBR=reed@google.com > > Committed: https://skia.googlesource.com/skia/+/20c1e3abfc681771f73eb19fde7284196e028940 > > Committed: https://skia.googlesource.com/skia/+/3dd9ed37c24611af86f0fe374bd3698b63f09450 TBR=bungeman@google.com,mtklein@chromium.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/1785353002
* Use std::unique_ptr.Gravatar mtklein2016-03-11
| | | | | | | | TBR=reed@google.com Committed: https://skia.googlesource.com/skia/+/20c1e3abfc681771f73eb19fde7284196e028940 Review URL: https://codereview.chromium.org/1780933003
* Revert of Use std::unique_ptr. (patchset #7 id:120001 of ↵Gravatar mtklein2016-03-10
| | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/1780933003/ ) Reason for revert: Now we remember! The problem was Clank: https://build.chromium.org/p/tryserver.chromium.android/builders/android_clang_dbg_recipe/builds/34329 Original issue's description: > Use std::unique_ptr. > > TBR=reed@google.com > > Committed: https://skia.googlesource.com/skia/+/20c1e3abfc681771f73eb19fde7284196e028940 TBR=bungeman@google.com,mtklein@chromium.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/1782973002
* Use std::unique_ptr.Gravatar mtklein2016-03-10
| | | | | | TBR=reed@google.com Review URL: https://codereview.chromium.org/1780933003
* 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
* Remove deferred clear from SkGpuDeviceGravatar bsalomon2016-02-05
| | | | | | | | | | | | | | | Add combining to GrClearBatch Fix issue with state tracking in GrGLGpu::createTestingOnlyBackendTexture Add tests for clearing GPU SkSurfaces and add tests for GrDrawContext::clear(). Add comment that SkCanvas::flush will resolve the RT in the GPU case. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1658823002 Review URL: https://codereview.chromium.org/1658823002
* Generate list of GPU contexts outside testsGravatar kkinnunen2015-12-01
| | | | | | | | | | | | Use DEF_GPUTEST_FOR_*_CONTEXT macros to obtain the test GPU context. Makes changing the context -related classes easier, since not all tests need to be changed. BUG=skia:2992 Review URL: https://codereview.chromium.org/1448873002
* Fix leaks in unit tests of GrGLTextureInfosGravatar bsalomon2015-11-11
| | | | | | TBR=egdaniel@google.com Review URL: https://codereview.chromium.org/1433353005
* Use a struct for client GL texture handlesGravatar bsalomon2015-11-10
| | | | Review URL: https://codereview.chromium.org/1429863009
* Remove separate cache for clip mask texturesGravatar bsalomon2015-10-02
| | | | Review URL: https://codereview.chromium.org/1377943003
* Fix leak in ResourceCache testGravatar Brian Salomon2015-09-24
| | | | Review URL: https://codereview.chromium.org/1359333004 .
* Make methods on GrGpuResource safe to call on abandoned resourceGravatar bsalomon2015-09-24
| | | | | | BUG=chromium:528908 Review URL: https://codereview.chromium.org/1367533004
* Move some of the adding stencil attachment logic of Gpu and into Render Target.Gravatar egdaniel2015-09-14
| | | | | | | | | | | | | | The new flow of calls for attaching a Stencil looks like: Client rt->attachStencilAttachment() gpu->getStencilAttachment() glgpu->createStencilAttachment() glrt->completeStencilAttachment() //actually attaches BUG=skia: Review URL: https://codereview.chromium.org/1333383002
* Style Change: NULL->nullptrGravatar halcanary2015-08-27
| | | | | | DOCS_PREVIEW= https://skia.org/?cl=1316233002 Review URL: https://codereview.chromium.org/1316233002
* Style Change: SkNEW->new; SkDELETE->deleteGravatar halcanary2015-08-26
| | | | | | DOCS_PREVIEW= https://skia.org/?cl=1316123003 Review URL: https://codereview.chromium.org/1316123003
* Defer flushes if kPreferNoIO is specifiedGravatar robertphillips2015-08-13
| | | | | | Prior to this patch clients who were solely uploading to textures (e.g., SW Mask Mgr) would cause extra flushes b.c., even though kPreferNoIO was being specified, resources with pending IO would still be returned even though there was plenty of space in the resource cache. Review URL: https://codereview.chromium.org/1286203002
* Implement caching of filled paths in the tessellated path renderer.Gravatar senorblanco2015-08-04
| | | | | | | | | | | | | | | | | | | | | | | | | Paths are cached as tessellated triangle meshes in vertex buffers on the GPU. Stroked paths are not (yet) cached. Paths containing no curved segments (linear paths) are reused at all scales. Paths containing curved segments are reused within a scale tolerance threshold. In order to invalidate the cache when an SkPath is changed or deleted, this required implementing genID change notification in SkPath. This is modelled almost exactly on SkPixelRef::GenIDChangeListener. However, It does not currently implement the check for unique genIDs, so notifiers will fire when the first instance of an SkPathRef using a given genID is destroyed. Another caveat is that you cannot successfully add a change notifier to an empty path, since it uses the "canonical" empty path which is never modified or destroyed. For this reason, we prevent adding listeners to it. BUG=skia:4121,skia:4122, 497403 DOCS_PREVIEW= https://skia.org/?cl=1114353004 Committed: https://skia.googlesource.com/skia/+/468dfa72eb6694145487be17876804dfca3b7adb Review URL: https://codereview.chromium.org/1114353004
* Revert "Implement caching of filled paths in the tessellated path renderer."Gravatar mtklein2015-08-04
| | | | | | | | | | | | | | | | | | This reverts commit 468dfa72eb6694145487be17876804dfca3b7adb. This CL caused signficant GM diffs. Revert "Fix resource cache test." This reverts commit b001c41ed37d2018d38ce787b412ed741585d75d. Revert "Fix SkData leaks at GrResourceKey::setCustomData() call sites." This reverts commit c369348aa596d7be05c9ce0ca5d349e5d1903789. These CLs depend on the first one. BUG=skia: TBR=bsalomon@google.com Review URL: https://codereview.chromium.org/1260363007
* Fix SkData leaks at GrResourceKey::setCustomData() call sites.Gravatar Stephen White2015-08-03
| | | | | | | BUG=skia: TBR=bsalomon@google.com Review URL: https://codereview.chromium.org/1270103003 .
* Fix resource cache test.Gravatar Stephen White2015-08-03
| | | | | | TBR=bsalomon@chromium.org Review URL: https://codereview.chromium.org/1257253007 .
* Implement caching of filled paths in the tessellated path renderer.Gravatar senorblanco2015-08-03
| | | | | | | | | | | | | | | | | | | | | | | Paths are cached as tessellated triangle meshes in vertex buffers on the GPU. Stroked paths are not (yet) cached. Paths containing no curved segments (linear paths) are reused at all scales. Paths containing curved segments are reused within a scale tolerance threshold. In order to invalidate the cache when an SkPath is changed or deleted, this required implementing genID change notification in SkPath. This is modelled almost exactly on SkPixelRef::GenIDChangeListener. However, It does not currently implement the check for unique genIDs, so notifiers will fire when the first instance of an SkPathRef using a given genID is destroyed. Another caveat is that you cannot successfully add a change notifier to an empty path, since it uses the "canonical" empty path which is never modified or destroyed. For this reason, we prevent adding listeners to it. BUG=skia:4121,skia:4122, 497403 DOCS_PREVIEW= https://skia.org/?cl=1114353004 Review URL: https://codereview.chromium.org/1114353004
* Various GL testing fixesGravatar jvanverth2015-07-16
| | | | | | | Check for GL context when printing NVPR error string. Fix some indenting. Review URL: https://codereview.chromium.org/1235283004
* Only run test_wrapped_resources() when GL is activeGravatar jvanverth2015-07-15
| | | | Review URL: https://codereview.chromium.org/1234233002
* Rename backing texture testing routinesGravatar jvanverth2015-07-14
| | | | Review URL: https://codereview.chromium.org/1230193006
* Remove GL-specific code from GMs and testsGravatar jvanverth2015-07-13
| | | | | | TBR=bsalomon@google.com Review URL: https://codereview.chromium.org/1232173002
* remove SkInstCntGravatar mtklein2015-06-26
| | | | | | | | | | | | | | It's been outclassed by Valgrind and leak sanitizer, and it seems to be causing problems for external folks building Skia. I'm not sure why our own builds seem unaffected. Latest thread: https://groups.google.com/forum/#!topic/skia-discuss/oj9FsQwwSF0 BUG=skia: Review URL: https://codereview.chromium.org/1217573002
* Revert of Revert of Return GrGLContext from GrTestTarget (patchset #1 id:1 ↵Gravatar reed2015-06-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | of https://codereview.chromium.org/1211123004/) Reason for revert: un-referting, did not help DEPS roll Original issue's description: > Revert of Return GrGLContext from GrTestTarget (patchset #3 id:40001 of https://codereview.chromium.org/1207393002/) > > Reason for revert: > speculative revert to unblock DEPS roll (layout-tests) > > Original issue's description: > > Return GrGLContext from GrTestTarget > > > > BUG=skia: > > > > Committed: https://skia.googlesource.com/skia/+/b6d93ea428ca5d13641c35faca7d0380980a3a17 > > TBR=bsalomon@google.com,joshualitt@google.com,joshualitt@chromium.org > NOPRESUBMIT=true > NOTREECHECKS=true > NOTRY=true > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/1852ec2b46a2a0efbb3550ff4d8b640f56a810e9 TBR=bsalomon@google.com,joshualitt@google.com,joshualitt@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/1215593002
* Revert of Return GrGLContext from GrTestTarget (patchset #3 id:40001 of ↵Gravatar reed2015-06-25
| | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/1207393002/) Reason for revert: speculative revert to unblock DEPS roll (layout-tests) Original issue's description: > Return GrGLContext from GrTestTarget > > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/b6d93ea428ca5d13641c35faca7d0380980a3a17 TBR=bsalomon@google.com,joshualitt@google.com,joshualitt@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/1211123004
* Return GrGLContext from GrTestTargetGravatar joshualitt2015-06-25
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/1207393002
* Add support for creating texture backed images where Skia will delete the ↵Gravatar bsalomon2015-06-18
| | | | | | texture. Review URL: https://codereview.chromium.org/1187523005
* Implement support for mixed sampled render targetsGravatar vbuzinov2015-06-12
| | | | | | | | | | | | | | | | | | Adds a new FBO type kStencil_MSFBOType that is selected whenever NV_framebuffer_mixed_samples extension is available. In this new FBO type a non-msaa color buffer is created with a multisampled stencil buffer attachment. Replaces numSamples() with separate numColorSamples and numStencilSamples methods in RenderTarget. In mixed samples mode non-MSAA codepaths are used to draw simple shapes, while NVPR-rendered paths and text are rendered with a multisampled stencil. BUG=skia:3177 Review URL: https://codereview.chromium.org/1001503002
* Add direct getter for GrCaps to GrContext.Gravatar bsalomon2015-05-29
| | | | | | | | TBR=joshualitt@google.com Committed: https://skia.googlesource.com/skia/+/9138c46e572085870638b6f7ad7fcdfcdf3cac99 Review URL: https://codereview.chromium.org/1149773005
* Revert of Add direct getter for GrCaps to GrContext. (patchset #4 id:60001 ↵Gravatar bsalomon2015-05-28
| | | | | | | | | | | | | | | | | | | | | of https://codereview.chromium.org/1149773005/) Reason for revert: Breaking Original issue's description: > Add direct getter for GrCaps to GrContext. > > TBR=joshualitt@google.com > > Committed: https://skia.googlesource.com/skia/+/9138c46e572085870638b6f7ad7fcdfcdf3cac99 TBR=joshualitt@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/1164443002
* Add direct getter for GrCaps to GrContext.Gravatar bsalomon2015-05-28
| | | | | | TBR=joshualitt@google.com Review URL: https://codereview.chromium.org/1149773005
* This replaces the texture creation/caching functions on GrContext with a ↵Gravatar bsalomon2015-04-30
| | | | | | GrTextureProvider interface. The goal is to pass this narrowly focused object in places that currently take a GrContext but don't need and shouldn't use its other methods. It also has an extended private interface for interacting with non-texture resource types. Review URL: https://codereview.chromium.org/1107973004
* Rename GrStencilBuffer to GrStencilAttachmentGravatar egdaniel2015-04-16
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/1083133002
* Add mechanism to proactively purge old resources in GrResourceCache.Gravatar bsalomon2015-04-08
| | | | | | This change leaves the feature turned off by default. Review URL: https://codereview.chromium.org/1032873002
* C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla}Gravatar mtklein2015-03-25
| | | | | | | | | NOPRESUBMIT=true BUG=skia: DOCS_PREVIEW= https://skia.org/?cl=1037793002 Review URL: https://codereview.chromium.org/1037793002
* Dynamically create stencil buffer when needed.Gravatar bsalomon2015-02-23
| | | | Review URL: https://codereview.chromium.org/938383004