| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef FindPropertiesNeedingUpdate_h | 5 #ifndef FindPropertiesNeedingUpdate_h |
| 6 #define FindPropertiesNeedingUpdate_h | 6 #define FindPropertiesNeedingUpdate_h |
| 7 | 7 |
| 8 #if DCHECK_IS_ON() | 8 #if DCHECK_IS_ON() |
| 9 | 9 |
| 10 #include "core/frame/LocalFrameView.h" | 10 #include "core/frame/LocalFrameView.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 // Both scope classes work by recording the paint property state of an object | 24 // Both scope classes work by recording the paint property state of an object |
| 25 // before rebuilding properties, forcing the properties to get updated, then | 25 // before rebuilding properties, forcing the properties to get updated, then |
| 26 // checking that the updated properties match the original properties. | 26 // checking that the updated properties match the original properties. |
| 27 | 27 |
| 28 #define DUMP_PROPERTIES(original, updated) \ | 28 #define DUMP_PROPERTIES(original, updated) \ |
| 29 "\nOriginal:\n" \ | 29 "\nOriginal:\n" \ |
| 30 << (original ? (original)->ToString().Ascii().data() : "null") \ | 30 << (original ? (original)->ToString().Ascii().data() : "null") \ |
| 31 << "\nUpdated:\n" \ | 31 << "\nUpdated:\n" \ |
| 32 << (updated ? (updated)->ToString().Ascii().data() : "null") | 32 << (updated ? (updated)->ToString().Ascii().data() : "null") |
| 33 | 33 |
| 34 #define CHECK_PROPERTY_EQ(thing, original, updated) \ | 34 #define CHECK_PROPERTY_EQ(thing, original, updated) \ |
| 35 do { \ | 35 do { \ |
| 36 DCHECK(!!original == !!updated) << "Property was created or deleted " \ | 36 DCHECK(!!original == !!updated) \ |
| 37 << "without " << thing \ | 37 << "Property was created or deleted " \ |
| 38 << " needing a paint property update." \ | 38 << "without " << thing << " needing a paint property update." \ |
| 39 << DUMP_PROPERTIES(original, updated); \ | 39 << DUMP_PROPERTIES(original, updated); \ |
| 40 if (!!original && !!updated) { \ | 40 if (!!original && !!updated) { \ |
| 41 DCHECK(*original == *updated) << "Property was updated without " \ | 41 DCHECK(*original == *updated) \ |
| 42 << thing \ | 42 << "Property was updated without " << thing \ |
| 43 << " needing a paint property update." \ | 43 << " needing a paint property update." \ |
| 44 << DUMP_PROPERTIES(original, updated); \ | 44 << DUMP_PROPERTIES(original, updated); \ |
| 45 } \ | 45 } \ |
| 46 } while (0) | 46 } while (0) |
| 47 | 47 |
| 48 #define DCHECK_FRAMEVIEW_PROPERTY_EQ(original, updated) \ | 48 #define DCHECK_FRAMEVIEW_PROPERTY_EQ(original, updated) \ |
| 49 CHECK_PROPERTY_EQ("the LocalFrameView", original, updated) | 49 CHECK_PROPERTY_EQ("the LocalFrameView", original, updated) |
| 50 | 50 |
| 51 class FindFrameViewPropertiesNeedingUpdateScope { | 51 class FindFrameViewPropertiesNeedingUpdateScope { |
| 52 public: | 52 public: |
| 53 FindFrameViewPropertiesNeedingUpdateScope(LocalFrameView* frame_view, | 53 FindFrameViewPropertiesNeedingUpdateScope(LocalFrameView* frame_view, |
| 54 bool force_subtree_update) | 54 bool force_subtree_update) |
| 55 : frame_view_(frame_view), | 55 : frame_view_(frame_view), |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 LayoutPoint original_paint_offset_; | 217 LayoutPoint original_paint_offset_; |
| 218 std::unique_ptr<const ObjectPaintProperties> original_properties_; | 218 std::unique_ptr<const ObjectPaintProperties> original_properties_; |
| 219 std::unique_ptr<const PropertyTreeState> | 219 std::unique_ptr<const PropertyTreeState> |
| 220 original_local_border_box_properties_; | 220 original_local_border_box_properties_; |
| 221 }; | 221 }; |
| 222 | 222 |
| 223 } // namespace blink | 223 } // namespace blink |
| 224 #endif // DCHECK_IS_ON() | 224 #endif // DCHECK_IS_ON() |
| 225 | 225 |
| 226 #endif // FindPropertiesNeedingUpdate_h | 226 #endif // FindPropertiesNeedingUpdate_h |
| OLD | NEW |