Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(543)

Issue 841263004: Simplify SkInstCnt (Closed)

Created:
5 years, 11 months ago by mtklein_C
Modified:
5 years, 11 months ago
Reviewers:
mtklein, robertphillips
CC:
reviews_skia.org
Base URL:
https://skia.googlesource.com/skia.git@master
Target Ref:
refs/heads/master
Project:
skia
Visibility:
Public.

Description

Simplify SkInstCnt This code requires fewer macros to use it (just one), has less code in macro definitions, and has simpler synchronization code (just atomic ints, no SkOnce, no SkMutex, etc.) A minor downside, we lose indentation and reverse-ordering in the final report: Leaked SkRefCntBase: 7 Leaked SkFontMgr: 1 Leaked SkWeakRefCnt: 1 Leaked SkTypeface: 1 Leaked SkFlattenable: 3 Leaked SkXfermode: 3 Leaked SkPathRef: 1 Leaked SkPixelRef: 1 Leaked SkMallocPixelRef: 1 becomes Leaked SkXfermode: 3 Leaked SkMallocPixelRef: 1 Leaked SkPixelRef: 1 Leaked SkPathRef: 1 Leaked SkFlattenable: 3 Leaked SkTypeface: 1 Leaked SkWeakRefCnt: 1 Leaked SkFontMgr: 1 Leaked SkRefCntBase: 7 This is motivated by wanting to land https://codereview.chromium.org/806473006/, which makes sure all static use of SkOnce are in global scope. The current implementation of SkInstCnt uses them in function scope, which isn't safe. BUG=skia: No public API changes. TBR=reed@google.com Committed: https://skia.googlesource.com/skia/+/6f07665768dc84453316e7b2bbd6049576764cb1

Patch Set 1 #

Total comments: 4

Patch Set 2 : robert #

Patch Set 3 : T:: #

Unified diffs Side-by-side diffs Delta from patch set Stats (+75 lines, -142 lines) Patch
M include/core/SkInstCnt.h View 1 2 1 chunk +58 lines, -125 lines 0 comments Download
M include/core/SkPath.h View 1 chunk +1 line, -1 line 0 comments Download
M include/core/SkRefCnt.h View 1 chunk +1 line, -1 line 0 comments Download
M include/core/SkStream.h View 1 chunk +1 line, -1 line 0 comments Download
M include/gpu/GrGpuResource.h View 2 chunks +2 lines, -2 lines 0 comments Download
M include/gpu/GrGpuResourceRef.h View 2 chunks +2 lines, -2 lines 0 comments Download
M include/gpu/GrProgramElement.h View 1 chunk +1 line, -1 line 0 comments Download
M include/gpu/GrTextureAccess.h View 1 chunk +1 line, -1 line 0 comments Download
M src/core/SkInstCnt.cpp View 1 1 chunk +2 lines, -2 lines 0 comments Download
M src/gpu/gl/GrGLCreateNullInterface.cpp View 3 chunks +3 lines, -3 lines 0 comments Download
M src/gpu/gl/GrGLGpuProgramCache.cpp View 1 chunk +1 line, -1 line 0 comments Download
M tests/GrMemoryPoolTest.cpp View 1 chunk +1 line, -1 line 0 comments Download
M tests/LListTest.cpp View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 13 (6 generated)
mtklein
5 years, 11 months ago (2015-01-12 19:25:12 UTC) #2
robertphillips
lgtm + nits https://codereview.chromium.org/841263004/diff/1/include/core/SkInstCnt.h File include/core/SkInstCnt.h (right): https://codereview.chromium.org/841263004/diff/1/include/core/SkInstCnt.h#newcode50 include/core/SkInstCnt.h:50: SkInstCount(const SkInstCount&) { Inc(); } == ...
5 years, 11 months ago (2015-01-13 14:21:37 UTC) #3
mtklein
https://codereview.chromium.org/841263004/diff/1/include/core/SkInstCnt.h File include/core/SkInstCnt.h (right): https://codereview.chromium.org/841263004/diff/1/include/core/SkInstCnt.h#newcode50 include/core/SkInstCnt.h:50: SkInstCount(const SkInstCount&) { Inc(); } On 2015/01/13 14:21:36, robertphillips ...
5 years, 11 months ago (2015-01-13 15:26:39 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/841263004/20001
5 years, 11 months ago (2015-01-13 15:28:20 UTC) #8
commit-bot: I haz the power
Try jobs failed on following builders: Test-Ubuntu13.10-GCE-NoGPU-x86_64-Debug-Trybot on client.skia (http://build.chromium.org/p/client.skia/builders/Test-Ubuntu13.10-GCE-NoGPU-x86_64-Debug-Trybot/builds/1510)
5 years, 11 months ago (2015-01-13 15:29:50 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/841263004/40001
5 years, 11 months ago (2015-01-13 16:12:30 UTC) #12
commit-bot: I haz the power
5 years, 11 months ago (2015-01-13 16:22:47 UTC) #13
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as
https://skia.googlesource.com/skia/+/6f07665768dc84453316e7b2bbd6049576764cb1

Powered by Google App Engine
This is Rietveld 408576698