aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/lazy/SkDiscardableMemoryPool.cpp
Commit message (Collapse)AuthorAge
* begin cleanup of malloc porting layerGravatar Mike Reed2018-01-05
| | | | | | | | | | | | | | 1. Merge some of the allocators into sk_malloc_flags by redefining a flag to mean zero-init 2. Add more private helpers to simplify our call-sites (and handle some overflow mul checks) 3. The 2-param helpers rely on the saturating SkSafeMath::Mul to pass max_size_t as the request, which should always fail. Bug:508641 Change-Id: I322f1e6ed91113467e0fdb12c91c3dad33d890c8 Reviewed-on: https://skia-review.googlesource.com/90940 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com> Reviewed-by: Stephan Altmueller <stephana@google.com>
* SkDiscardableMemoryPool: always have a mutex for testingGravatar Hal Canary2017-05-05
| | | | | | | Change-Id: I898058f1125f62832f2b2b661c661efb0f84da6d Reviewed-on: https://skia-review.googlesource.com/14274 Commit-Queue: Hal Canary <halcanary@google.com> Reviewed-by: Herb Derby <herb@google.com>
* SkDiscardableMemoryPool: modernizeGravatar Hal Canary2017-04-25
| | | | | | | | | | * Use unique_ptr, sk_sp, SkAutoFree, using. * Rely on thread-safe static global initializion. Change-Id: I7c14e0e57622163b1b81b97a218b816fe6d02926 Reviewed-on: https://skia-review.googlesource.com/13818 Commit-Queue: Hal Canary <halcanary@google.com> Reviewed-by: Herb Derby <herb@google.com>
* Change SkMemory to the more accurately named SkMalloc.Gravatar Herb Derby2017-03-27
| | | | | | | Change-Id: I6b08a74234b99bac866bad71014b94f7ec2d4bc8 Reviewed-on: https://skia-review.googlesource.com/10188 Commit-Queue: Herb Derby <herb@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* Mark overridden destructors with 'override' and remove 'virtual'Gravatar Brian Salomon2017-03-22
| | | | | | | | | This silences a new warning in clang 5.0 Change-Id: Ieb5b75a6ffed60107c3fd16075d2ecfd515b55e8 Reviewed-on: https://skia-review.googlesource.com/10006 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org>
* Make SkMemory.h and adjust all files for usage.Gravatar Herb Derby2017-03-20
| | | | | | | | | | | | This will be rolled out in three stages: 1) make SkMemory.h and have SkTypes.h include it. 2) Adjust chromium and android. 3) no long include SkMemory.h in SkTypes.h Change-Id: If360ef5e1164d88f50b03f279e2e963ca2f57d5d Reviewed-on: https://skia-review.googlesource.com/9874 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Herb Derby <herb@google.com>
* SkOncePtr -> SkOnceGravatar mtklein2016-05-05
| | | | | | | | | | | | | | | | It's always nice to kill off a synchronization primitive. And while less terse, I think this new code reads more clearly. ... and, SkOncePtr's tests were the only thing now using sk_num_cores() outside of SkTaskGroup, so I've hidden it as static inside SkTaskGroup.cpp. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1953533002 CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot Committed: https://skia.googlesource.com/skia/+/9bd3fc7fa9bb7cad050bd619aa93d4c48ebb5c02 Review-Url: https://codereview.chromium.org/1953533002
* Revert of SkOncePtr -> SkOnce (patchset #1 id:1 of ↵Gravatar reed2016-05-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/1949313003/ ) Reason for revert: ok, I have no idea what's going on Original issue's description: > Reland of SkOncePtr -> SkOnce (patchset #1 id:1 of https://codereview.chromium.org/1945293004/ ) > > Reason for revert: > previous revert unneeded (I think) > > Original issue's description: > > Revert of SkOncePtr -> SkOnce (patchset #4 id:60001 of https://codereview.chromium.org/1953533002/ ) > > > > Reason for revert: > > broken the Mac and Linux builders, e.g.: > > > > https://build.chromium.org/p/chromium/builders/Mac/builds/15151 > > https://build.chromium.org/p/chromium/builders/Linux%20x64/builds/19052 > > > > Original issue's description: > > > SkOncePtr -> SkOnce > > > > > > It's always nice to kill off a synchronization primitive. > > > And while less terse, I think this new code reads more clearly. > > > > > > ... and, SkOncePtr's tests were the only thing now using sk_num_cores() > > > outside of SkTaskGroup, so I've hidden it as static inside SkTaskGroup.cpp. > > > > > > BUG=skia: > > > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1953533002 > > > CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot > > > > > > Committed: https://skia.googlesource.com/skia/+/9bd3fc7fa9bb7cad050bd619aa93d4c48ebb5c02 > > > > TBR=herb@google.com,mtklein@chromium.org > > # Skipping CQ checks because original CL landed less than 1 days ago. > > NOPRESUBMIT=true > > NOTREECHECKS=true > > NOTRY=true > > BUG=skia: > > > > Committed: https://skia.googlesource.com/skia/+/7eb33da7eede34c050b865dbb1b60c3dcea7191b > > TBR=herb@google.com,mtklein@chromium.org > # Skipping CQ checks because original CL landed less than 1 days ago. > NOPRESUBMIT=true > NOTREECHECKS=true > NOTRY=true > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/82da9a8aa0ce648f36882830765b42e0ada6c0fa TBR=herb@google.com,mtklein@chromium.org # 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/1948313002
* Reland of SkOncePtr -> SkOnce (patchset #1 id:1 of ↵Gravatar reed2016-05-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/1945293004/ ) Reason for revert: previous revert unneeded (I think) Original issue's description: > Revert of SkOncePtr -> SkOnce (patchset #4 id:60001 of https://codereview.chromium.org/1953533002/ ) > > Reason for revert: > broken the Mac and Linux builders, e.g.: > > https://build.chromium.org/p/chromium/builders/Mac/builds/15151 > https://build.chromium.org/p/chromium/builders/Linux%20x64/builds/19052 > > Original issue's description: > > SkOncePtr -> SkOnce > > > > It's always nice to kill off a synchronization primitive. > > And while less terse, I think this new code reads more clearly. > > > > ... and, SkOncePtr's tests were the only thing now using sk_num_cores() > > outside of SkTaskGroup, so I've hidden it as static inside SkTaskGroup.cpp. > > > > BUG=skia: > > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1953533002 > > CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot > > > > Committed: https://skia.googlesource.com/skia/+/9bd3fc7fa9bb7cad050bd619aa93d4c48ebb5c02 > > TBR=herb@google.com,mtklein@chromium.org > # Skipping CQ checks because original CL landed less than 1 days ago. > NOPRESUBMIT=true > NOTREECHECKS=true > NOTRY=true > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/7eb33da7eede34c050b865dbb1b60c3dcea7191b TBR=herb@google.com,mtklein@chromium.org # 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/1949313003
* Revert of Modernize SkMutex and SkSemaphore. (patchset #2 id:20001 of ↵Gravatar sclittle2016-05-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/1947153002/ ) Reason for revert: This CL seems to have broken the Linux x64 and Mac bots, e.g. https://build.chromium.org/p/chromium/builders/Linux%20x64/builds/19052 https://build.chromium.org/p/chromium/builders/Mac/builds/15151 The error appears to have something to do with new static initializers being added. Original issue's description: > Modernize SkMutex and SkSemaphore. > > - use <atomic> > - fuse SkMutex and SkBaseMutex > - fuse SkSemaphore and SkBaseSemaphore > > Still TODO: > - replace SK_DECLARE_STATIC_MUTEX(name) with static SkMutex name > > I just didn't want to bother fixing all that up until I know this CL sticks. > > BUG=skia: > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1947153002 > > No public API changes. > TBR=reed@google.com > > Committed: https://skia.googlesource.com/skia/+/427c2819d9237d7d7729c59238036cfc73c072ea TBR=herb@google.com,mtklein@chromium.org,reed@google.com,bsalomon@google.com # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=609340 Review-Url: https://codereview.chromium.org/1945343003
* Revert of SkOncePtr -> SkOnce (patchset #4 id:60001 of ↵Gravatar reed2016-05-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/1953533002/ ) Reason for revert: broken the Mac and Linux builders, e.g.: https://build.chromium.org/p/chromium/builders/Mac/builds/15151 https://build.chromium.org/p/chromium/builders/Linux%20x64/builds/19052 Original issue's description: > SkOncePtr -> SkOnce > > It's always nice to kill off a synchronization primitive. > And while less terse, I think this new code reads more clearly. > > ... and, SkOncePtr's tests were the only thing now using sk_num_cores() > outside of SkTaskGroup, so I've hidden it as static inside SkTaskGroup.cpp. > > BUG=skia: > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1953533002 > CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot > > Committed: https://skia.googlesource.com/skia/+/9bd3fc7fa9bb7cad050bd619aa93d4c48ebb5c02 TBR=herb@google.com,mtklein@chromium.org # 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/1945293004
* Revert of SK_DECLARE_STATIC_MUTEX -> static SkMutex (patchset #1 id:1 of ↵Gravatar reed2016-05-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/1948193002/ ) Reason for revert: broken the Mac and Linux builders, e.g.: https://build.chromium.org/p/chromium/builders/Mac/builds/15151 https://build.chromium.org/p/chromium/builders/Linux%20x64/builds/19052 Original issue's description: > SK_DECLARE_STATIC_MUTEX -> static SkMutex > > There's no need to use a macro to declare static SkMutexes any more > (and there's likewise no need to restrict them to global scope). > > BUG=skia: > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1948193002 > > Committed: https://skia.googlesource.com/skia/+/5e56cfd3fa1041dbb83899844fb92fa9a2ef1009 TBR=mtklein@google.com,mtklein@chromium.org # 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/1945353003
* SK_DECLARE_STATIC_MUTEX -> static SkMutexGravatar mtklein2016-05-04
| | | | | | | | | | There's no need to use a macro to declare static SkMutexes any more (and there's likewise no need to restrict them to global scope). BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1948193002 Review-Url: https://codereview.chromium.org/1948193002
* SkOncePtr -> SkOnceGravatar mtklein2016-05-04
| | | | | | | | | | | | | | It's always nice to kill off a synchronization primitive. And while less terse, I think this new code reads more clearly. ... and, SkOncePtr's tests were the only thing now using sk_num_cores() outside of SkTaskGroup, so I've hidden it as static inside SkTaskGroup.cpp. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1953533002 CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot Review-Url: https://codereview.chromium.org/1953533002
* Modernize SkMutex and SkSemaphore.Gravatar mtklein2016-05-04
| | | | | | | | | | | | | | | | | | | - use <atomic> - fuse SkMutex and SkBaseMutex - fuse SkSemaphore and SkBaseSemaphore Still TODO: - replace SK_DECLARE_STATIC_MUTEX(name) with static SkMutex name I just didn't want to bother fixing all that up until I know this CL sticks. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1947153002 No public API changes. TBR=reed@google.com Review-Url: https://codereview.chromium.org/1947153002
* don't peek w/o first acquiring the lockGravatar reed2015-09-09
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/1324503005
* Port uses of SkLazyPtr to SkOncePtr.Gravatar mtklein2015-09-09
| | | | | | | | | | | | | | | | This gives SkOncePtr a non-trivial destructor that uses std::default_delete by default. This is overrideable, as seen in SkColorTable. SK_DECLARE_STATIC_ONCE_PTR still just leaves its pointers hanging at EOP. BUG=skia: No public API changes. TBR=reed@google.com Committed: https://skia.googlesource.com/skia/+/a1254acdb344174e761f5061c820559dab64a74c Review URL: https://codereview.chromium.org/1322933005
* Revert of Port uses of SkLazyPtr to SkOncePtr. (patchset #7 id:110001 of ↵Gravatar mtklein2015-09-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/1322933005/ ) Reason for revert: Breaks Chrome roll. obj/skia/ext/skia_chrome.skia_memory_dump_provider.o does not have -I include/private on its include path, but transitively includes SkMessageBus.h. Original issue's description: > Port uses of SkLazyPtr to SkOncePtr. > > This gives SkOncePtr a non-trivial destructor that uses std::default_delete > by default. This is overrideable, as seen in SkColorTable. > > SK_DECLARE_STATIC_ONCE_PTR still just leaves its pointers hanging at EOP. > > BUG=skia: > > No public API changes. > TBR=reed@google.com > > Committed: https://skia.googlesource.com/skia/+/a1254acdb344174e761f5061c820559dab64a74c TBR=herb@google.com,mtklein@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/1334523002
* Port uses of SkLazyPtr to SkOncePtr.Gravatar mtklein2015-09-09
| | | | | | | | | | | | | | This gives SkOncePtr a non-trivial destructor that uses std::default_delete by default. This is overrideable, as seen in SkColorTable. SK_DECLARE_STATIC_ONCE_PTR still just leaves its pointers hanging at EOP. BUG=skia: No public API changes. TBR=reed@google.com Review URL: https://codereview.chromium.org/1322933005
* 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
* Remove SkThread.h, include SkMutex.h or SkAtomics.h as appropriate.Gravatar mtklein2015-07-07
| | | | | | | | | | | | | | SkThread.h doesn't do anything anymore execept include those two, and thankfully, it doesn't seem to be mentioned outside Skia. No public API changes. TBR=reed@google.com BUG=skia: Committed: https://skia.googlesource.com/skia/+/c50acf2321d7a934c80d754e9cbe936dfb8eb4cc Review URL: https://codereview.chromium.org/1215393002
* Revert of Remove SkThread.h, include SkMutex.h or SkAtomics.h as ↵Gravatar jvanverth2015-07-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | appropriate. (patchset #4 id:60001 of https://codereview.chromium.org/1215393002/) Reason for revert: Breaking the roll. E.g. on android_chromium_gn_compile_dbg: FAILED: /b/build/goma/gomacc ../../third_party/android_tools/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++ -MMD -MF obj/skia/ext/libskia.SkMemory_new_handler.o.d -DV8_DEPRECATION_WARNINGS -DCLD_VERSION=1 -DENABLE_NOTIFICATIONS -DENABLE_BROWSER_CDMS -DENABLE_PRINTING=1 -DENABLE_BASIC_PRINTING=1 -DDONT_EMBED_BUILD_METADATA -DUSE_OPENSSL=1 -DUSE_OPENSSL_CERTS=1 -DNO_TCMALLOC -DDISABLE_NACL -DENABLE_CONFIGURATION_POLICY -DENABLE_SUPERVISED_USERS=1 -DENABLE_AUTOFILL_DIALOG=1 -DUSE_PROPRIETARY_CODECS -DV8_USE_EXTERNAL_STARTUP_DATA -DVIDEO_HOLE=1 -DMOBILE_SAFE_BROWSING -DSAFE_BROWSING_SERVICE -DCHROMIUM_BUILD -D_FILE_OFFSET_BITS=64 -DANDROID -DHAVE_SYS_UIO_H -DCOMPONENT_BUILD -D__GNU_SOURCE=1 -D_DEBUG -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DWTF_USE_DYNAMIC_ANNOTATIONS=1 -DSKIA_IMPLEMENTATION=1 -DSK_ARM_HAS_OPTIONAL_NEON -DSK_GAMMA_APPLY_TO_A8 -DSK_GAMMA_EXPONENT=1.4 -DSK_GAMMA_CONTRAST=0.0 -DSK_DEFAULT_FONT_CACHE_LIMIT=1048576 -DSK_IGNORE_LINEONLY_AA_CONVEX_PATH_OPTS -DSKIA_DLL -DGR_GL_IGNORE_ES3_MSAA=0 -DSK_SUPPORT_GPU=1 -DSK_BUILD_FOR_ANDROID -DUSE_CHROMIUM_SKIA -DXML_STATIC -I../.. -Igen -I../../third_party/skia/include/private -I../../third_party/skia/src/core -I../../third_party/skia/src/image -I../../third_party/skia/src/opts -I../../third_party/skia/src/pdf -I../../third_party/skia/src/ports -I../../third_party/skia/src/sfnt -I../../third_party/skia/src/utils -I../../third_party/skia/src/lazy -I../../skia/config -I../../skia/ext -I../../third_party/skia/include/c -I../../third_party/skia/include/config -I../../third_party/skia/include/core -I../../third_party/skia/include/effects -I../../third_party/skia/include/images -I../../third_party/skia/include/lazy -I../../third_party/skia/include/pathops -I../../third_party/skia/include/pdf -I../../third_party/skia/include/pipe -I../../third_party/skia/include/ports -I../../third_party/skia/include/utils -I../../third_party/skia/include/gpu -I../../third_party/skia/src/gpu -I../../third_party/zlib -I../../third_party/expat/files/lib -I../../third_party/freetype-android/include -I../../third_party/freetype-android/src/include -I../../third_party/android_tools/ndk/sources/android/cpufeatures -fno-strict-aliasing -march=armv7-a -mfloat-abi=softfp -mtune=generic-armv7-a -mthumb -mthumb-interwork -fno-tree-sra -fno-caller-saves -funwind-tables -fPIC -pipe -ffunction-sections -funwind-tables -fno-short-enums -finline-limit=64 -mfpu=vfpv3-d16 -isystem../../third_party/android_tools/ndk/sources/cxx-stl/llvm-libc++/libcxx/include -isystem../../third_party/android_tools/ndk/sources/cxx-stl/llvm-libc++abi/libcxxabi/include -isystem../../third_party/android_tools/ndk/sources/android/support/include -fvisibility=hidden --sysroot=/b/build/slave/android_chromium_gn/build/src/third_party/android_tools/ndk/platforms/android-16/arch-arm -Os -fdata-sections -ffunction-sections -fomit-frame-pointer -g1 -Wno-format -Wendif-labels -Werror -Wno-missing-field-initializers -Wno-unused-parameter -Wno-psabi -Wno-extra -Wno-ignored-qualifiers -Wno-type-limits -Wno-unused-local-typedefs -fno-threadsafe-statics -fvisibility-inlines-hidden -std=gnu++11 -fno-rtti -fno-exceptions -Wno-deprecated -Wno-narrowing -Wno-literal-suffix -Wno-error=c++0x-compat -Wno-non-virtual-dtor -Wno-sign-promo -c ../../skia/ext/SkMemory_new_handler.cpp -o obj/skia/ext/libskia.SkMemory_new_handler.o ../../skia/ext/SkMemory_new_handler.cpp:12:52: fatal error: third_party/skia/include/core/SkThread.h: No such file or directory #include "third_party/skia/include/core/SkThread.h" Original issue's description: > Remove SkThread.h, include SkMutex.h or SkAtomics.h as appropriate. > > SkThread.h doesn't do anything anymore execept include those two, > and thankfully, it doesn't seem to be mentioned outside Skia. > > No public API changes. > TBR=reed@google.com > > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/c50acf2321d7a934c80d754e9cbe936dfb8eb4cc TBR=mtklein@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/1214603003
* Remove SkThread.h, include SkMutex.h or SkAtomics.h as appropriate.Gravatar mtklein2015-07-01
| | | | | | | | | | | | SkThread.h doesn't do anything anymore execept include those two, and thankfully, it doesn't seem to be mentioned outside Skia. No public API changes. TBR=reed@google.com BUG=skia: Review URL: https://codereview.chromium.org/1215393002
* Fix DiscardableMemoryPool::free race conditionGravatar halcanary2015-03-26
| | | | | | BUG=skia:3596 Review URL: https://codereview.chromium.org/1017943003
* 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
* Fix up all the easy virtual ... SK_OVERRIDE cases.Gravatar mtklein2015-01-09
| | | | | | | | | | | | This fixes every case where virtual and SK_OVERRIDE were on the same line, which should be the bulk of cases. We'll have to manually clean up the rest over time unless I level up in regexes. for f in (find . -type f); perl -p -i -e 's/virtual (.*)SK_OVERRIDE/\1SK_OVERRIDE/g' $f; end BUG=skia: Review URL: https://codereview.chromium.org/806653007
* Require SK_DECLARE_STATIC_LAZY_PTR is used in global scope.Gravatar mtklein2014-10-13
| | | | | | | | | | | | | Function- or method- local scope isn't threadsafe; the pointer is generally zero-initialized on first use in function scope (i.e. lazily... we have to go deeper), but for globals we can be pretty sure the linker will do that for us. BUG=skia: No public API changes. TBR=reed@google.com Review URL: https://codereview.chromium.org/651723003
* "NULL !=" = NULLGravatar bsalomon2014-09-05
| | | | | | | | R=reed@google.com Author: bsalomon@google.com Review URL: https://codereview.chromium.org/544233002
* remove SkPurgeGlobalDiscardableMemoryPoolGravatar halcanary2014-08-25
| | | | | | | | | BUG=skia:2721 R=reed@google.com Author: halcanary@google.com Review URL: https://codereview.chromium.org/495453004
* Fix no previous prototype for function errorGravatar halcanary2014-07-02
| | | | | | | | | BUG=skia:2720 R=scroggo@google.com, caryclark@google.com Author: halcanary@google.com Review URL: https://codereview.chromium.org/363983002
* Use new SkBaseMutex::assertHeld() in DiscardableMemoryPoolGravatar halcanary2014-06-11
| | | | | | | | R=mtklein@google.com Author: halcanary@google.com Review URL: https://codereview.chromium.org/324413003
* Port most uses of SkOnce to SkLazyPtr.Gravatar mtklein2014-06-02
| | | | | | | | | | | | | | BUG=skia: Committed: http://code.google.com/p/skia/source/detail?r=15006 Committed: http://code.google.com/p/skia/source/detail?r=15014 R=reed@google.com, mtklein@google.com Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/304383005
* Revert of Port most uses of SkOnce to SkLazyPtr. ↵Gravatar commit-bot@chromium.org2014-05-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (https://codereview.chromium.org/304383005/) Reason for revert: linux x86-64 release segfault in src/ports/SkFontHost_fontconfig.cpp:107 http://108.170.220.120:10117/builders/Test-Ubuntu12-ShuttleA-GTX660-x86_64-Release/builds/905/steps/RunTests/logs/stdio Original issue's description: > Port most uses of SkOnce to SkLazyPtr. > > BUG=skia: > > Committed: http://code.google.com/p/skia/source/detail?r=15006 > > Committed: http://code.google.com/p/skia/source/detail?r=15014 R=reed@google.com, mtklein@chromium.org TBR=mtklein@chromium.org, reed@google.com NOTREECHECKS=true NOTRY=true BUG=skia: Author: mtklein@google.com Review URL: https://codereview.chromium.org/306063004 git-svn-id: http://skia.googlecode.com/svn/trunk@15015 2bbb7eff-a529-9590-31e7-b0007b416f81
* Port most uses of SkOnce to SkLazyPtr.Gravatar commit-bot@chromium.org2014-05-30
| | | | | | | | | | | | | | BUG=skia: Committed: http://code.google.com/p/skia/source/detail?r=15006 R=reed@google.com, mtklein@google.com Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/304383005 git-svn-id: http://skia.googlecode.com/svn/trunk@15014 2bbb7eff-a529-9590-31e7-b0007b416f81
* Revert of Port most uses of SkOnce to SkLazyPtr. ↵Gravatar commit-bot@chromium.org2014-05-30
| | | | | | | | | | | | | | | | | | | | | | | | | | (https://codereview.chromium.org/304383005/) Reason for revert: Leaking refs on SkTypeface on Macs. Original issue's description: > Port most uses of SkOnce to SkLazyPtr. > > BUG=skia: > > Committed: http://code.google.com/p/skia/source/detail?r=15006 R=reed@google.com, mtklein@chromium.org TBR=mtklein@chromium.org, reed@google.com NOTREECHECKS=true NOTRY=true BUG=skia: Author: mtklein@google.com Review URL: https://codereview.chromium.org/304283007 git-svn-id: http://skia.googlecode.com/svn/trunk@15009 2bbb7eff-a529-9590-31e7-b0007b416f81
* Port most uses of SkOnce to SkLazyPtr.Gravatar commit-bot@chromium.org2014-05-30
| | | | | | | | | | | BUG=skia: R=reed@google.com, mtklein@google.com Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/304383005 git-svn-id: http://skia.googlecode.com/svn/trunk@15006 2bbb7eff-a529-9590-31e7-b0007b416f81
* Add SkPurgeGlobalDiscardableMemoryPool, needed to replace SkImageRefGravatar commit-bot@chromium.org2014-05-28
| | | | | | | | | | | BUG=skia:2389 R=reed@google.com, scroggo@google.com Author: halcanary@google.com Review URL: https://codereview.chromium.org/298423002 git-svn-id: http://skia.googlecode.com/svn/trunk@14925 2bbb7eff-a529-9590-31e7-b0007b416f81
* SkDiscardableMemoryPool to abstract classGravatar commit-bot@chromium.org2014-04-04
| | | | | | | | | | | | Motivation - we want to keep our public headers small. R=scroggo@google.com, reed@google.com Author: halcanary@google.com Review URL: https://codereview.chromium.org/223403012 git-svn-id: http://skia.googlecode.com/svn/trunk@14063 2bbb7eff-a529-9590-31e7-b0007b416f81
* be sure to unlock the discardablememory before deleting itGravatar reed@google.com2013-12-12
| | | | | | | | BUG= Review URL: https://codereview.chromium.org/114673002 git-svn-id: http://skia.googlecode.com/svn/trunk@12658 2bbb7eff-a529-9590-31e7-b0007b416f81
* Big Cleanup: SkBitmapFactory, SkLazyPixelRef, SkImageCacheGravatar halcanary@google.com2013-12-05
Removed SkBitmapFactory since no clients were using it. New cache selection mechanism can simply pass a SkDiscardableMemory::Factory into the SkDiscardablePixelRef if non-default SkDiscardableMemory should be used. Removed BitmapFactoryTest. SkDiscardableMemory::Factory interface. Android will need this functionality in the future inside their BitmapFactory. Removed SkLazyPixelRef, since it's functionality is now subsumed into SkDiscardablePixelRef. Removed LazyPixelRef test. Modified SkDiscardablePixelRef to optionally allow it to use a SkDiscardableMemory::Factory. This tiny change makes it a replacement for SkLazyPixelRef. This functioanlity is also necessary for moving Android over to SkDiscardablePixelRef from SkImageRef in a later CL. Added a test for this. SkDecodingImageGenerator::Install can optionally pass a factory in to SkDiscardablePixelRef. Removed SkImageCache, SkLruImageCache, and SkPurgeableImageCache. This functionality can be handled much more cleanly by SkDiscardableMemory. New SkDiscardableMemoryPool class to replace SkLruImageCache. In a later CL, we will replace SkImageRef_GlobalPool (used by android) as well. This is a concrete implementation of SkDiscardableMemory::Factory. Added a test for this. modified gm/factory.cpp to remove dependnce on SkBitmapFactory + SkLruImageCache. Now uses SkDecodingImageGenerator + SkDiscardablePixelRef + SkDiscardableMemoryPool. SkImageDecoder::Target replaces SkBitmapFactory::Target. The DecodeMemoryToTarget function may disappear in the future. Moved SkLazyCachingPixelRef::DecodeProc replaces SkBitmapFactory::DecodeProc. This is a short term change, since another CL changes SkLazyCachingPixelRef to use SkImageGenerator instead of DecodeProc. Modified DrawBitmapRectTest to use SkDiscardablePixelRef instead of SkLazyPixelRef. tools/LazyDecodeBitmap.cpp now uses SkDecodingImageGenerator + SkDiscardablePixelRef instead of a SkBitmapFactory. bench_pictures uses the Global SkDiscardableMemoryPool instead of a global gLruImageCache. R=reed@google.com, scroggo@google.com Review URL: https://codereview.chromium.org/103033002 git-svn-id: http://skia.googlecode.com/svn/trunk@12515 2bbb7eff-a529-9590-31e7-b0007b416f81