Chromium Code Reviews| Index: third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp |
| diff --git a/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp b/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp |
| index b683998817426e2df60f8eccd7cb2ee8849c6265..abac89ad0d12435a375518455a2bcfe31e763261 100644 |
| --- a/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp |
| +++ b/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp |
| @@ -286,7 +286,7 @@ void GraphicsLayer::Paint(const IntRect* interest_rect, |
| GetRasterInvalidationTrackingMap().Add(this); |
| tracking.last_painted_record = std::move(record); |
| tracking.last_interest_rect = previous_interest_rect_; |
| - tracking.raster_invalidation_region_since_last_paint = Region(); |
| + tracking.invalidation_region_since_last_paint = Region(); |
| } |
| } |
| } |
| @@ -482,14 +482,14 @@ void GraphicsLayer::ResetTrackedRasterInvalidations() { |
| return; |
| if (RuntimeEnabledFeatures::paintUnderInvalidationCheckingEnabled()) |
| - tracking->tracked_raster_invalidations.clear(); |
| + tracking->tracked_invalidations.clear(); |
| else |
| GetRasterInvalidationTrackingMap().Remove(this); |
| } |
| bool GraphicsLayer::HasTrackedRasterInvalidations() const { |
| if (auto* tracking = GetRasterInvalidationTracking()) |
| - return !tracking->tracked_raster_invalidations.IsEmpty(); |
| + return !tracking->tracked_invalidations.IsEmpty(); |
| return false; |
| } |
| @@ -504,25 +504,12 @@ void GraphicsLayer::TrackRasterInvalidation(const DisplayItemClient& client, |
| if (!IsTrackingOrCheckingRasterInvalidations() || rect.IsEmpty()) |
| return; |
| - RasterInvalidationTracking& tracking = |
| - GetRasterInvalidationTrackingMap().Add(this); |
| - |
| - if (is_tracking_raster_invalidations_) { |
| - RasterInvalidationInfo info; |
| - info.client = &client; |
| - info.client_debug_name = client.DebugName(); |
| - info.rect = rect; |
| - info.reason = reason; |
| - tracking.tracked_raster_invalidations.push_back(info); |
| - } |
| - |
| - if (RuntimeEnabledFeatures::paintUnderInvalidationCheckingEnabled()) { |
|
chrishtr
2017/05/10 17:25:33
No longer needed?
Xianzhu
2017/05/10 18:27:01
This is moved into RasterInvalidationTrackingMap::
|
| - // TODO(crbug.com/496260): Some antialiasing effects overflow the paint |
| - // invalidation rect. |
| - IntRect r = rect; |
| - r.Inflate(1); |
| - tracking.raster_invalidation_region_since_last_paint.Unite(r); |
| - } |
| + RasterInvalidationInfo info; |
| + info.client = &client; |
| + info.client_debug_name = client.DebugName(); |
| + info.rect = rect; |
| + info.reason = reason; |
| + GetRasterInvalidationTrackingMap().AddInvalidation(this, info); |
| } |
| template <typename T> |
| @@ -1266,13 +1253,12 @@ void GraphicsLayer::CheckPaintUnderInvalidations( |
| SkColor old_pixel = old_bitmap.getColor(bitmap_x, bitmap_y); |
| SkColor new_pixel = new_bitmap.getColor(bitmap_x, bitmap_y); |
| if (PixelsDiffer(old_pixel, new_pixel) && |
| - !tracking->raster_invalidation_region_since_last_paint.Contains( |
| + !tracking->invalidation_region_since_last_paint.Contains( |
| IntPoint(layer_x, layer_y))) { |
| if (mismatching_pixels < kMaxMismatchesToReport) { |
| - UnderPaintInvalidation under_paint_invalidation = { |
| - layer_x, layer_y, old_pixel, new_pixel}; |
| - tracking->under_paint_invalidations.push_back( |
| - under_paint_invalidation); |
| + UnderRasterInvalidation under_invalidation = {layer_x, layer_y, |
| + old_pixel, new_pixel}; |
| + tracking->under_invalidations.push_back(under_invalidation); |
| LOG(ERROR) << DebugName() |
| << " Uninvalidated old/new pixels mismatch at " << layer_x |
| << "," << layer_y << " old:" << std::hex << old_pixel |