Bug 1454713. WebRenderUserData: Drop unnecessary T::Type() check. r=kats
authorJeff Muizelaar <jmuizelaar@mozilla.com>
Tue, 17 Apr 2018 13:52:45 -0400
changeset 414080 5f548a6b01e6f056743a83a9edd32f32c85216c9
parent 414079 2b620b4826e3f976dfe94f28e1b2fdf54906365f
child 414081 86badb90129d251ed51205dc9ca438b39f55f0bd
push id62791
push userjmuizelaar@mozilla.com
push dateTue, 17 Apr 2018 18:27:59 +0000
treeherderautoland@5f548a6b01e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats
bugs1454713
milestone61.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1454713. WebRenderUserData: Drop unnecessary T::Type() check. r=kats Now that WebRenderUserData's a keyed on T::Type() we don't need to check it after doing the lookup.
gfx/layers/wr/WebRenderCommandBuilder.h
gfx/layers/wr/WebRenderUserData.h
--- a/gfx/layers/wr/WebRenderCommandBuilder.h
+++ b/gfx/layers/wr/WebRenderCommandBuilder.h
@@ -128,17 +128,17 @@ public:
       frame->GetProperty(WebRenderUserDataProperty::Key());
 
     if (!userDataTable) {
       userDataTable = new WebRenderUserDataTable();
       frame->AddProperty(WebRenderUserDataProperty::Key(), userDataTable);
     }
 
     RefPtr<WebRenderUserData>& data = userDataTable->GetOrInsert(WebRenderUserDataKey(aItem->GetPerFrameKey(), T::Type()));
-    if (!data || (data->GetType() != T::Type())) {
+    if (!data) {
       // To recreate a new user data, we should remove the data from the table first.
       if (data) {
         data->RemoveFromTable();
       }
       data = new T(mManager, aItem);
       mWebRenderUserDatas.PutEntry(data);
       if (aOutIsRecycled) {
         *aOutIsRecycled = false;
--- a/gfx/layers/wr/WebRenderUserData.h
+++ b/gfx/layers/wr/WebRenderUserData.h
@@ -219,17 +219,17 @@ GetWebRenderUserData(nsIFrame* aFrame, u
   MOZ_ASSERT(aFrame);
   WebRenderUserDataTable* userDataTable =
     aFrame->GetProperty(WebRenderUserDataProperty::Key());
   if (!userDataTable) {
     return nullptr;
   }
 
   WebRenderUserData* data = userDataTable->GetWeak(WebRenderUserDataKey(aPerFrameKey, T::Type()));
-  if (data && (data->GetType() == T::Type())) {
+  if (data) {
     RefPtr<T> result = static_cast<T*>(data);
     return result.forget();
   }
 
   return nullptr;
 }
 
 } // namespace layers