| Index: third_party/WebKit/Source/platform/graphics/paint/RasterInvalidationTracking.h
|
| diff --git a/third_party/WebKit/Source/platform/graphics/paint/RasterInvalidationTracking.h b/third_party/WebKit/Source/platform/graphics/paint/RasterInvalidationTracking.h
|
| index 945cc82cec92e53f221482b82858ead1f5c6e5a8..aeb1d1235a7290d5b15a43f06c9e2dc8734fb353 100644
|
| --- a/third_party/WebKit/Source/platform/graphics/paint/RasterInvalidationTracking.h
|
| +++ b/third_party/WebKit/Source/platform/graphics/paint/RasterInvalidationTracking.h
|
| @@ -5,6 +5,7 @@
|
| #ifndef RasterInvalidationTracking_h
|
| #define RasterInvalidationTracking_h
|
|
|
| +#include "platform/RuntimeEnabledFeatures.h"
|
| #include "platform/geometry/IntRect.h"
|
| #include "platform/geometry/Region.h"
|
| #include "platform/graphics/PaintInvalidationReason.h"
|
| @@ -22,11 +23,10 @@ struct RasterInvalidationInfo {
|
| DISALLOW_NEW_EXCEPT_PLACEMENT_NEW();
|
| // This is for comparison only. Don't dereference because the client may have
|
| // died.
|
| - const DisplayItemClient* client;
|
| + const DisplayItemClient* client = nullptr;
|
| String client_debug_name;
|
| IntRect rect;
|
| - PaintInvalidationReason reason;
|
| - RasterInvalidationInfo() : reason(kPaintInvalidationFull) {}
|
| + PaintInvalidationReason reason = kPaintInvalidationFull;
|
| };
|
|
|
| inline bool operator==(const RasterInvalidationInfo& a,
|
| @@ -34,7 +34,7 @@ inline bool operator==(const RasterInvalidationInfo& a,
|
| return a.rect == b.rect;
|
| }
|
|
|
| -struct UnderPaintInvalidation {
|
| +struct UnderRasterInvalidation {
|
| DISALLOW_NEW_EXCEPT_PLACEMENT_NEW();
|
| int x;
|
| int y;
|
| @@ -44,11 +44,13 @@ struct UnderPaintInvalidation {
|
|
|
| struct PLATFORM_EXPORT RasterInvalidationTracking {
|
| DISALLOW_NEW_EXCEPT_PLACEMENT_NEW();
|
| - Vector<RasterInvalidationInfo> tracked_raster_invalidations;
|
| + Vector<RasterInvalidationInfo> invalidations;
|
| +
|
| + // The following fields are for under-raster-invalidation detection.
|
| sk_sp<PaintRecord> last_painted_record;
|
| IntRect last_interest_rect;
|
| - Region raster_invalidation_region_since_last_paint;
|
| - Vector<UnderPaintInvalidation> under_paint_invalidations;
|
| + Region invalidation_region_since_last_paint;
|
| + Vector<UnderRasterInvalidation> under_invalidations;
|
|
|
| void AsJSON(JSONObject*);
|
| };
|
| @@ -57,25 +59,24 @@ template <class TargetClass>
|
| class PLATFORM_EXPORT RasterInvalidationTrackingMap {
|
| public:
|
| void AsJSON(TargetClass* key, JSONObject* json) {
|
| - auto it = invalidation_tracking_map_.find(key);
|
| - if (it != invalidation_tracking_map_.end())
|
| + auto it = map_.find(key);
|
| + if (it != map_.end())
|
| it->value.AsJSON(json);
|
| }
|
|
|
| void Remove(TargetClass* key) {
|
| - auto it = invalidation_tracking_map_.find(key);
|
| - if (it != invalidation_tracking_map_.end())
|
| - invalidation_tracking_map_.erase(it);
|
| + auto it = map_.find(key);
|
| + if (it != map_.end())
|
| + map_.erase(it);
|
| }
|
|
|
| RasterInvalidationTracking& Add(TargetClass* key) {
|
| - return invalidation_tracking_map_.insert(key, RasterInvalidationTracking())
|
| - .stored_value->value;
|
| + return map_.insert(key, RasterInvalidationTracking()).stored_value->value;
|
| }
|
|
|
| RasterInvalidationTracking* Find(TargetClass* key) {
|
| - auto it = invalidation_tracking_map_.find(key);
|
| - if (it == invalidation_tracking_map_.end())
|
| + auto it = map_.find(key);
|
| + if (it == map_.end())
|
| return nullptr;
|
| return &it->value;
|
| }
|
| @@ -83,7 +84,7 @@ class PLATFORM_EXPORT RasterInvalidationTrackingMap {
|
| private:
|
| typedef HashMap<TargetClass*, RasterInvalidationTracking>
|
| InvalidationTrackingMap;
|
| - InvalidationTrackingMap invalidation_tracking_map_;
|
| + InvalidationTrackingMap map_;
|
| };
|
|
|
| } // namespace blink
|
|
|