diff options
author | 2016-01-08 10:09:13 -0800 | |
---|---|---|
committer | 2016-01-08 10:09:13 -0800 | |
commit | de8dc7e9201a14759076ea4090bdf8a54791817b (patch) | |
tree | cab9f8016becc1e89e56512f0ff88d2b3e148a01 /include | |
parent | 2c3176c18fcb0ef1594ca9dfbcabcb5e86086301 (diff) |
Reland of Make a single GrSingleOwner in GrContext (patchset #1 id:1 of https://codereview.chromium.org/1565303003/ )
Reason for revert:
trying again
Original issue's description:
> Revert of Make a single GrSingleOwner in GrContext (patchset #3 id:40001 of https://codereview.chromium.org/1563703004/ )
>
> Reason for revert:
> breaking asan
>
> Original issue's description:
> > Make a single GrSingleOwner in GrContext
> >
> > TBR=bsalomon@google.com
> > BUG=skia:
> > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1563703004
> >
> > Committed: https://skia.googlesource.com/skia/+/f9bc796e0dbd31674c22b34761913ee6e8fdd66a
>
> TBR=robertphillips@google.com,joshualitt@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/+/94da292e39db0d41da08b1d6055ca5e0d6b498cc
TBR=robertphillips@google.com,joshualitt@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/1572653002
Diffstat (limited to 'include')
-rw-r--r-- | include/gpu/GrContext.h | 4 | ||||
-rw-r--r-- | include/gpu/GrDrawContext.h | 5 | ||||
-rw-r--r-- | include/private/GrSingleOwner.h | 2 |
3 files changed, 8 insertions, 3 deletions
diff --git a/include/gpu/GrContext.h b/include/gpu/GrContext.h index a49d141810..54db1953d5 100644 --- a/include/gpu/GrContext.h +++ b/include/gpu/GrContext.h @@ -395,7 +395,9 @@ private: SkMutex fTestPMConversionsMutex; // In debug builds we guard against improper thread handling - SkDEBUGCODE(mutable GrSingleOwner fSingleOwner;) + // This guard is passed to the GrDrawingManager and, from there to all the + // GrDrawContexts. It is also passed to the GrTextureProvider and SkGpuDevice. + mutable GrSingleOwner fSingleOwner; struct CleanUpData { PFCleanUpFunc fFunc; diff --git a/include/gpu/GrDrawContext.h b/include/gpu/GrDrawContext.h index 21977bed74..7ae6f5e682 100644 --- a/include/gpu/GrDrawContext.h +++ b/include/gpu/GrDrawContext.h @@ -283,7 +283,8 @@ private: SkDEBUGCODE(void validate() const;) - GrDrawContext(GrDrawingManager*, GrRenderTarget*, const SkSurfaceProps* surfaceProps); + GrDrawContext(GrDrawingManager*, GrRenderTarget*, const SkSurfaceProps* surfaceProps, + GrSingleOwner*); void internalDrawPath(GrPipelineBuilder*, const SkMatrix& viewMatrix, @@ -309,7 +310,7 @@ private: SkSurfaceProps fSurfaceProps; // In debug builds we guard against improper thread handling - SkDEBUGCODE(mutable GrSingleOwner fSingleOwner;) + mutable GrSingleOwner* fSingleOwner; }; #endif diff --git a/include/private/GrSingleOwner.h b/include/private/GrSingleOwner.h index dea982e89a..64e63d3b19 100644 --- a/include/private/GrSingleOwner.h +++ b/include/private/GrSingleOwner.h @@ -48,6 +48,8 @@ private: SkThreadID fOwner; // guarded by fMutex int fReentranceCount; // guarded by fMutex }; +#else +class GrSingleOwner {}; // Provide a dummy implementation so we can pass pointers to constructors #endif #endif |