Commit Graph

10 Commits

Author SHA1 Message Date
herb
3667d5bf3f Add subtract to atomics.
BUG=skia:

Review URL: https://codereview.chromium.org/1348113004
2015-09-16 07:46:17 -07:00
herb
cd7f035974 Revert of Parallel cache - preliminary (patchset #24 id:460001 of https://codereview.chromium.org/1264103003/ )
Reason for revert:
Breaks DrMemory in the chrome roll.

Original issue's description:
> Parallel cache.
>
> TBR=reed@google.com
>
> BUG=skia:1330,528560
>
> Committed: https://skia.googlesource.com/skia/+/6f2a486040cb25465990196c229feb47e668e87f
>
> Committed: https://skia.googlesource.com/skia/+/bf2988833e5a36c6b430da6fdd2cfebd0015adec
>
> Committed: https://skia.googlesource.com/skia/+/014ffdb01ea5317614a1569efc30c50f06434222

TBR=reed@google.com,mtklein@google.com,mtklein@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:1330,528560

Review URL: https://codereview.chromium.org/1345903002
2015-09-15 15:15:41 -07:00
herb
014ffdb01e Parallel cache.
TBR=reed@google.com

BUG=skia:1330,528560

Committed: https://skia.googlesource.com/skia/+/6f2a486040cb25465990196c229feb47e668e87f

Committed: https://skia.googlesource.com/skia/+/bf2988833e5a36c6b430da6fdd2cfebd0015adec

Review URL: https://codereview.chromium.org/1264103003
2015-09-15 07:03:03 -07:00
jyasskin
951d854327 Revert of Parallel cache - preliminary (patchset #23 id:440001 of https://codereview.chromium.org/1264103003/ )
Also reverts https://codereview.chromium.org/1333003002/ which was layered on top.

Reason for revert:
Appears to leak GDI handles: http://build.chromium.org/p/chromium.memory.fyi/builders/Windows%20Unit%20%28DrMemory%20full%29%20%282%29/builds/8247

~~Dr.M~~ Error #1: HANDLE LEAK: GDI handle 0x03050a84 and 3 similar handle(s) were opened but not closed:
~~Dr.M~~ # 0 system call NtGdiCreateDIBSection
~~Dr.M~~ # 1 GDI32.dll!CreateDIBSection                                                +0xdc     (0x768ead23 <GDI32.dll+0x1ad23>)
~~Dr.M~~ # 2 skia.dll!HDCOffscreen::draw                                                [third_party\skia\src\ports\skfonthost_win.cpp:499]
~~Dr.M~~ # 3 skia.dll!SkScalerContext_GDI::generateImage                                [third_party\skia\src\ports\skfonthost_win.cpp:1233]
~~Dr.M~~ # 4 skia.dll!SkScalerContext::getImage                                         [third_party\skia\src\core\skscalercontext.cpp:530]
~~Dr.M~~ # 5 skia.dll!SkGlyphCache::OnceFillInImage                                     [third_party\skia\src\core\skglyphcache.cpp:252]
~~Dr.M~~ # 6 skia.dll!sk_once_slow<>                                                    [third_party\skia\include\core\skonce.h:76]
~~Dr.M~~ # 7 skia.dll!SkGlyphCache::findImage                                           [third_party\skia\src\core\skglyphcache.cpp:260]
~~Dr.M~~ # 8 skia.dll!D1G_RectClip                                                      [third_party\skia\src\core\skdraw.cpp:1479]
~~Dr.M~~ # 9 skia.dll!SkDraw::drawPosText                                               [third_party\skia\src\core\skdraw.cpp:1838]
~~Dr.M~~ #10 skia.dll!SkBitmapDevice::drawPosText                                       [third_party\skia\src\core\skbitmapdevice.cpp:348]
~~Dr.M~~ #11 skia.dll!SkCanvas::onDrawPosText                                           [third_party\skia\src\core\skcanvas.cpp:2433]
~~Dr.M~~ #12 skia.dll!SkCanvas::drawPosText                                             [third_party\skia\src\core\skcanvas.cpp:2507]
~~Dr.M~~ #13 skia.dll!SkRecords::Draw::draw<>                                           [third_party\skia\src\core\skrecorddraw.cpp:109]
~~Dr.M~~ #14 skia.dll!SkRecord::Record::visit<>                                         [third_party\skia\src\core\skrecord.h:170]
~~Dr.M~~ #15 skia.dll!SkRecordDraw                                                      [third_party\skia\src\core\skrecorddraw.cpp:55]
~~Dr.M~~ #16 skia.dll!SkBigPicture::playback                                            [third_party\skia\src\core\skbigpicture.cpp:43]
~~Dr.M~~ #17 skia.dll!SkCanvas::onDrawPicture                                           [third_party\skia\src\core\skcanvas.cpp:2800]
~~Dr.M~~ #18 skia.dll!SkCanvas::drawPicture                                             [third_party\skia\src\core\skcanvas.cpp:2770]
~~Dr.M~~ #19 cc.dll!cc::DrawingDisplayItem::Raster                                      [cc\playback\drawing_display_item.cc:51]
~~Dr.M~~ #20 cc.dll!cc::DisplayItemList::Raster                                         [cc\playback\display_item_list.cc:107]
~~Dr.M~~ #21 cc.dll!cc::DisplayListRasterSource::RasterCommon                           [cc\playback\display_list_raster_source.cc:122]
~~Dr.M~~ #22 cc.dll!cc::DisplayListRasterSource::PlaybackToCanvas                       [cc\playback\display_list_raster_source.cc:100]
~~Dr.M~~ #23 cc.dll!cc::TileTaskWorkerPool::PlaybackToMemory                            [cc\raster\tile_task_worker_pool.cc:208]
~~Dr.M~~ #24 cc.dll!cc::OneCopyTileTaskWorkerPool::PlaybackAndCopyOnWorkerThread        [cc\raster\one_copy_tile_task_worker_pool.cc:413]
~~Dr.M~~ #25 cc.dll!cc::`anonymous namespace'::RasterBufferImpl::Playback               [cc\raster\one_copy_tile_task_worker_pool.cc:53]
~~Dr.M~~ #26 cc.dll!cc::`anonymous namespace'::RasterTaskImpl::Raster                   [cc\tiles\tile_manager.cc:131]
~~Dr.M~~ #27 cc.dll!cc::`anonymous namespace'::RasterTaskImpl::RunOnWorkerThread        [cc\tiles\tile_manager.cc:90]
~~Dr.M~~ #28 cc.dll!cc::TaskGraphRunner::RunTaskWithLockAcquired                        [cc\raster\task_graph_runner.cc:418]
~~Dr.M~~ #29 cc.dll!cc::TaskGraphRunner::Run                                            [cc\raster\task_graph_runner.cc:361]
~~Dr.M~~ #30 base.dll!base::SimpleThread::ThreadMain                                    [base\threading\simple_thread.cc:66]
~~Dr.M~~ #31 base.dll!base::`anonymous namespace'::ThreadFunc                           [base\threading\platform_thread_win.cc:82]
~~Dr.M~~ #32 KERNEL32.dll!BaseThreadInitThunk                                          +0x11     (0x7570337a <KERNEL32.dll+0x1337a>)
~~Dr.M~~ Note: @0:15:51.087 in thread 196
~~Dr.M~~ Note: handles created with the same callstack are closed here:
~~Dr.M~~ Note: # 0 system call NtGdiDeleteObjectApp
~~Dr.M~~ Note: # 1 GDI32.dll!DeleteObject                                                    +0x149    (0x768e57d3 <GDI32.dll+0x157d3>)
~~Dr.M~~ Note: # 2 skia.dll!HDCOffscreen::draw                                                [third_party\skia\src\ports\skfonthost_win.cpp:471]
~~Dr.M~~ Note: # 3 skia.dll!SkScalerContext_GDI::generateImage                                [third_party\skia\src\ports\skfonthost_win.cpp:1233]
~~Dr.M~~ Note: # 4 skia.dll!SkScalerContext::getImage                                         [third_party\skia\src\core\skscalercontext.cpp:530]
~~Dr.M~~ Note: # 5 skia.dll!SkGlyphCache::OnceFillInImage                                     [third_party\skia\src\core\skglyphcache.cpp:252]
~~Dr.M~~ Note: # 6 skia.dll!sk_once_slow<>                                                    [third_party\skia\include\core\skonce.h:76]
~~Dr.M~~ Note: # 7 skia.dll!SkGlyphCache::findImage                                           [third_party\skia\src\core\skglyphcache.cpp:260]
~~Dr.M~~ Note: # 8 skia.dll!D1G_RectClip                                                      [third_party\skia\src\core\skdraw.cpp:1479]
~~Dr.M~~ Note: # 9 skia.dll!SkDraw::drawPosText                                               [third_party\skia\src\core\skdraw.cpp:1838]
~~Dr.M~~ Note: #10 skia.dll!SkBitmapDevice::drawPosText                                       [third_party\skia\src\core\skbitmapdevice.cpp:348]
~~Dr.M~~ Note: #11 skia.dll!SkCanvas::onDrawPosText                                           [third_party\skia\src\core\skcanvas.cpp:2433]
~~Dr.M~~ Note: #12 skia.dll!SkCanvas::drawPosText                                             [third_party\skia\src\core\skcanvas.cpp:2507]
~~Dr.M~~ Note: #13 skia.dll!SkRecords::Draw::draw<>                                           [third_party\skia\src\core\skrecorddraw.cpp:109]
~~Dr.M~~ Note: #14 skia.dll!SkRecord::Record::visit<>                                         [third_party\skia\src\core\skrecord.h:170]
~~Dr.M~~ Note: #15 skia.dll!SkRecordDraw                                                      [third_party\skia\src\core\skrecorddraw.cpp:55]
~~Dr.M~~ Note: #16 skia.dll!SkBigPicture::playback                                            [third_party\skia\src\core\skbigpicture.cpp:43]
~~Dr.M~~ Note: #17 skia.dll!SkCanvas::onDrawPicture                                           [third_party\skia\src\core\skcanvas.cpp:2800]
~~Dr.M~~ Note: #18 skia.dll!SkCanvas::drawPicture                                             [third_party\skia\src\core\skcanvas.cpp:2770]
~~Dr.M~~ Note: #19 cc.dll!cc::DrawingDisplayItem::Raster                                      [cc\playback\drawing_display_item.cc:51]
~~Dr.M~~ Note: #20 cc.dll!cc::DisplayItemList::Raster                                         [cc\playback\display_item_list.cc:107]
~~Dr.M~~ Note: #21 cc.dll!cc::DisplayListRasterSource::RasterCommon                           [cc\playback\display_list_raster_source.cc:122]
~~Dr.M~~ Note: #22 cc.dll!cc::DisplayListRasterSource::PlaybackToCanvas                       [cc\playback\display_list_raster_source.cc:100]
~~Dr.M~~ Note: #23 cc.dll!cc::TileTaskWorkerPool::PlaybackToMemory                            [cc\raster\tile_task_worker_pool.cc:208]
~~Dr.M~~ Note: #24 cc.dll!cc::OneCopyTileTaskWorkerPool::PlaybackAndCopyOnWorkerThread        [cc\raster\one_copy_tile_task_worker_pool.cc:413]
~~Dr.M~~ Note: #25 cc.dll!cc::`anonymous namespace'::RasterBufferImpl::Playback               [cc\raster\one_copy_tile_task_worker_pool.cc:53]
~~Dr.M~~ Note: #26 cc.dll!cc::`anonymous namespace'::RasterTaskImpl::Raster                   [cc\tiles\tile_manager.cc:131]
~~Dr.M~~ Note: #27 cc.dll!cc::`anonymous namespace'::RasterTaskImpl::RunOnWorkerThread        [cc\tiles\tile_manager.cc:90]
~~Dr.M~~ Note: #28 cc.dll!cc::TaskGraphRunner::RunTaskWithLockAcquired                        [cc\raster\task_graph_runner.cc:418]
~~Dr.M~~ Note: #29 cc.dll!cc::TaskGraphRunner::Run                                            [cc\raster\task_graph_runner.cc:361]
~~Dr.M~~ Note: #30 base.dll!base::SimpleThread::ThreadMain                                    [base\threading\simple_thread.cc:66]
~~Dr.M~~ Note: #31 base.dll!base::`anonymous namespace'::ThreadFunc                           [base\threading\platform_thread_win.cc:82]
~~Dr.M~~ Note: #32 KERNEL32.dll!BaseThreadInitThunk                                          +0x11     (0x7570337a <KERNEL32.dll+0x1337a>)

Original issue's description:
> Parallel cache.
>
> TBR=reed@google.com
>
> BUG=skia:1330
>
> Committed: https://skia.googlesource.com/skia/+/6f2a486040cb25465990196c229feb47e668e87f
>
> Committed: https://skia.googlesource.com/skia/+/bf2988833e5a36c6b430da6fdd2cfebd0015adec

TBR=reed@google.com,mtklein@google.com,mtklein@chromium.org,herb@google.com
BUG=skia:1330

[mtklein mucking around]
NOTREECHECKS=true

Review URL: https://codereview.chromium.org/1339493002
2015-09-10 18:11:29 -07:00
herb
bf2988833e Parallel cache.
TBR=reed@google.com

BUG=skia:1330

Committed: https://skia.googlesource.com/skia/+/6f2a486040cb25465990196c229feb47e668e87f

Review URL: https://codereview.chromium.org/1264103003
2015-09-09 12:16:10 -07:00
herb
ef2df09997 Revert of Parallel cache - preliminary (patchset #22 id:420001 of https://codereview.chromium.org/1264103003/ )
Reason for revert:
Seems to freeze android devices.

Original issue's description:
> Parallel cache.
>
> TBR=reed@google.com
>
> BUG=skia:1330
>
> Committed: https://skia.googlesource.com/skia/+/6f2a486040cb25465990196c229feb47e668e87f

TBR=reed@google.com,mtklein@google.com,mtklein@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:1330

Review URL: https://codereview.chromium.org/1327703003
2015-09-04 14:19:45 -07:00
herb
6f2a486040 Parallel cache.
TBR=reed@google.com

BUG=skia:1330

Review URL: https://codereview.chromium.org/1264103003
2015-09-04 10:38:58 -07:00
mtklein
50ffd9921e Extract the spinlock from SkOnce as SkSpinlock.
This uses slightly newer APIs from SkAtomics.h to make it a bit more efficient.

No public API changes.
TBR=reed@google.com

BUG=skia:

Review URL: https://codereview.chromium.org/1039323002
2015-03-30 08:13:34 -07:00
mtklein
a669bc7a7a Atomics overhaul.
This merges and refactors SkAtomics.h and SkBarriers.h into SkAtomics.h and
some ports/ implementations. The major new feature is that we can express
memory orders explicitly rather than only through comments.

The porting layer is reduced to four template functions:
  - sk_atomic_load
  - sk_atomic_store
  - sk_atomic_fetch_add
  - sk_atomic_compare_exchange
From those four we can reconstruct all our previous sk_atomic_foo.

There are three ports:
  - SkAtomics_std:    uses C++11 <atomic>,             used with MSVC
  - SkAtomics_atomic: uses newer GCC/Clang intrinsics, used on not-MSVC where possible
  - SkAtomics_sync:   uses older GCC/Clang intrinsics, used where SkAtomics_atomic not supported

No public API changes.
TBR=reed@google.com

BUG=skia:

Review URL: https://codereview.chromium.org/896553002
2015-02-02 12:22:07 -08:00
mtklein
a64c48f4f9 Move sync code to include/, switch from using platform define to a proxy header in core/
This fixes two problems:
  1)  #include SK_SOME_DEFINE doesn't work well for all our clients.
  2)  Things in include/ are #including things in src/, which we don't like.

TBR=reed@google.com

BUG=skia:

Review URL: https://codereview.chromium.org/862983002
2015-01-21 13:13:31 -08:00