aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/ResourceCacheTest.cpp
Commit message (Collapse)AuthorAge
* 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
* Speculative fix for nexus player unit test failureGravatar bsalomon2015-02-19
| | | | | | | | TBR=robertphillips@google.com NOTREECHECKS=true Review URL: https://codereview.chromium.org/941433006
* Handle the case when the GrResourceCache timestamp wraps.Gravatar bsalomon2015-02-19
| | | | | | NOTREECHECKS=true Review URL: https://codereview.chromium.org/916103006
* Recycle stencil buffers across render targets.Gravatar bsalomon2015-02-19
| | | | Review URL: https://codereview.chromium.org/939093002
* 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
* 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
* Rename GrResourceCache2->GrResourceCacheGravatar bsalomon2015-02-11
| | | | | | TBR=robertphillips@google.com Review URL: https://codereview.chromium.org/921453002
* Reimplement gpu message bus for invalidated bitmap gen IDsGravatar bsalomon2015-02-06
| | | | Review URL: https://codereview.chromium.org/902873002
* 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
* Reland https://codereview.chromium.org/860333002 with fix for test failures.Gravatar bsalomon2015-01-21
| | | | | | | | | | Revert "Revert of Make GrScratchKey memory buffer correct size on copy (patchset #1 id:1 of https://codereview.chromium.org/860333002/)" This reverts commit 988018c817f341c0ce09297b7ba5ba60ba76eba9. BUG=skia: Review URL: https://codereview.chromium.org/863983003
* Revert of Make GrScratchKey memory buffer correct size on copy (patchset #1 ↵Gravatar mtklein2015-01-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | id:1 of https://codereview.chromium.org/860333002/) Reason for revert: Our Valgrind bot just spewed out a weird error. I don't know if it's related, but it looks at least like one of the stacks was in the right area, so I'm going to revert this precautionarily. Sorry if this is a false positive. http://build.chromium.org/p/client.skia/builders/Test-Ubuntu12-ShuttleA-GTX550Ti-x86_64-Release-Valgrind/builds/266/steps/dm/logs/stdio Original issue's description: > Make GrScratchKey memory buffer correct size on copy > > Scratch key memory buffer of a copy of a key was too big. The (new) copy > was N times uint32_t bytes instead of N bytes. > > Adds few tests to resource cache. These tests would not catch the too > big buffer. This is just a precaution for too small buffers. The main > idea of the test change is that the scratch key should contain some > information, so that lookup with a scratch key can also return no > match. Otherwise testing of scratch lookup result is not indicative of > correct code (eg. no-information scratch key will always match). > > Committed: https://skia.googlesource.com/skia/+/711ef4831363fb8cbdf061dc2c36c65b13c0ccf2 TBR=bsalomon@google.com,kkinnunen@nvidia.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/864833003
* Make GrScratchKey memory buffer correct size on copyGravatar kkinnunen2015-01-21
| | | | | | | | | | | | | | Scratch key memory buffer of a copy of a key was too big. The (new) copy was N times uint32_t bytes instead of N bytes. Adds few tests to resource cache. These tests would not catch the too big buffer. This is just a precaution for too small buffers. The main idea of the test change is that the scratch key should contain some information, so that lookup with a scratch key can also return no match. Otherwise testing of scratch lookup result is not indicative of correct code (eg. no-information scratch key will always match). Review URL: https://codereview.chromium.org/860333002
* 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
* Revert "Use scratch keys for stencil buffers."Gravatar bsalomon2014-11-24
| | | | | | | | | | | | | | | | This reverts commit 91175f19664a62851da4ca4e0984a7c7c45b258f. Revert "Cleanup res cache bench and split out into a unit test." This reverts commit 4e4303f002c5958c6c958e7ba8e49b24c25f0b22. Revert "rebaselines" This reverts commit 65ba7b57759bfca60b24bc34dc46fc8caaf146f0. TBR=tomhudson@google.com Review URL: https://codereview.chromium.org/752233002
* Cleanup res cache bench and split out into a unit test.Gravatar bsalomon2014-11-24
| | | | | | BUG=skia:2889 Review URL: https://codereview.chromium.org/754833002
* 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