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

Issue 749683002: Revert of Add SkNVRefCnt, prune down SkPicture's size (Closed)

Created:
6 years, 1 month ago by humper
Modified:
6 years, 1 month ago
CC:
reviews_skia.org
Base URL:
https://skia.googlesource.com/skia.git@master
Project:
skia
Visibility:
Public.

Description

Revert of Add SkNVRefCnt, prune down SkPicture's size (patchset #10 id:170001 of https://codereview.chromium.org/741793002/) Reason for revert: Breaking Canary and DEPS roll Original issue's description: > Add SkNVRefCnt, prune down SkPicture's size > > SkNVRefCnt is a variant of SkRefCnt that's Not Virtual, so weighs 4 bytes > instead of 8 or 16. There's only benefit to doing this if the deriving class > does not otherwise need a vtable, e.g. SkPicture. > > I've stripped out some cruft from SkPicture, rearranged fields to pack tightly, > and added compile asserts for the sizes of SkPicture, SkRecord, and > SkVarAlloc. > > BUG=skia:3144 > > Committed: https://skia.googlesource.com/skia/+/08d1fccf6eeec0a9fd5421e59e4d05daccf6e339 TBR=bungeman@google.com,reed@google.com,mtklein@google.com,tomhudson@google.com,reed@chromium.org,mtklein@chromium.org NOTREECHECKS=true NOTRY=true BUG=skia:3144

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+30 lines, -49 lines) Patch
M gm/gmmain.cpp View 4 chunks +4 lines, -4 lines 0 comments Download
M include/core/SkPicture.h View 5 chunks +11 lines, -7 lines 0 comments Download
M include/core/SkRefCnt.h View 1 chunk +1 line, -20 lines 0 comments Download
M src/core/SkRecord.h View 1 chunk +3 lines, -6 lines 0 comments Download
M src/core/SkRecorder.cpp View 2 chunks +9 lines, -9 lines 0 comments Download
M src/core/SkVarAlloc.h View 1 chunk +0 lines, -1 line 0 comments Download
M tests/PictureTest.cpp View 2 chunks +2 lines, -2 lines 0 comments Download

Messages

Total messages: 4 (1 generated)
humper
Created Revert of Add SkNVRefCnt, prune down SkPicture's size
6 years, 1 month ago (2014-11-20 21:39:30 UTC) #1
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/749683002/1
6 years, 1 month ago (2014-11-20 21:39:42 UTC) #2
commit-bot: I haz the power
6 years, 1 month ago (2014-11-20 21:39:57 UTC) #4
Failed to apply patch for include/core/SkRefCnt.h:
While running git apply --index -3 -p1;
  error: patch failed: include/core/SkRefCnt.h:247
  Falling back to three-way merge...
  Applied patch to 'include/core/SkRefCnt.h' with conflicts.
  U include/core/SkRefCnt.h

Patch:       include/core/SkRefCnt.h
Index: include/core/SkRefCnt.h
diff --git a/include/core/SkRefCnt.h b/include/core/SkRefCnt.h
index
9b246f4f5499eeed6bfa12ad596beb275bd0b545..4da2fbbc936266662a4510b64a8ce3a9de921972
100644
--- a/include/core/SkRefCnt.h
+++ b/include/core/SkRefCnt.h
@@ -247,23 +247,4 @@
 };
 #define SkAutoUnref(...) SK_REQUIRE_LOCAL_VAR(SkAutoUnref)
 
-// This is a variant of SkRefCnt that's Not Virtual, so weighs 4 bytes instead
of 8 or 16.
-// There's only benefit to using this if the deriving class does not otherwise
need a vtable.
-template <typename Derived>
-class SkNVRefCnt : SkNoncopyable {
-public:
-    SkNVRefCnt() : fRefCnt(1) {}
-
-    // Implementation is pretty much the same as SkRefCntBase. All required
barriers are the same:
-    //   - unique() needs acquire when it returns true, and no barrier if it
returns false;
-    //   - ref() doesn't need any barrier;
-    //   - unref() needs a release barrier, and an acquire if it's going to
call delete.
-
-    bool unique() const { return 1 == sk_acquire_load(&fRefCnt); }
-    void    ref() const { sk_atomic_inc(&fRefCnt); }
-    void  unref() const { if (1 == sk_atomic_dec(&fRefCnt)) { SkDELETE((const
Derived*)this); } }
-private:
-    mutable int32_t fRefCnt;
-};
-
-#endif
+#endif

Powered by Google App Engine
This is Rietveld 408576698