OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 Client()->SubpixelAccumulation(); | 270 Client()->SubpixelAccumulation(); |
271 } | 271 } |
272 | 272 |
273 IntRect GraphicsLayer::InterestRect() { | 273 IntRect GraphicsLayer::InterestRect() { |
274 return previous_interest_rect_; | 274 return previous_interest_rect_; |
275 } | 275 } |
276 | 276 |
277 void GraphicsLayer::Paint(const IntRect* interest_rect, | 277 void GraphicsLayer::Paint(const IntRect* interest_rect, |
278 GraphicsContext::DisabledMode disabled_mode) { | 278 GraphicsContext::DisabledMode disabled_mode) { |
279 if (PaintWithoutCommit(interest_rect, disabled_mode)) { | 279 if (PaintWithoutCommit(interest_rect, disabled_mode)) { |
280 GetPaintController().CommitNewDisplayItems( | 280 GetPaintController().CommitNewDisplayItems(); |
281 OffsetFromLayoutObjectWithSubpixelAccumulation()); | |
282 if (RuntimeEnabledFeatures::paintUnderInvalidationCheckingEnabled()) { | 281 if (RuntimeEnabledFeatures::paintUnderInvalidationCheckingEnabled()) { |
283 sk_sp<PaintRecord> record = CaptureRecord(); | 282 sk_sp<PaintRecord> record = CaptureRecord(); |
284 CheckPaintUnderInvalidations(record); | 283 CheckPaintUnderInvalidations(record); |
285 RasterInvalidationTracking& tracking = | 284 RasterInvalidationTracking& tracking = |
286 GetRasterInvalidationTrackingMap().Add(this); | 285 GetRasterInvalidationTrackingMap().Add(this); |
287 tracking.last_painted_record = std::move(record); | 286 tracking.last_painted_record = std::move(record); |
288 tracking.last_interest_rect = previous_interest_rect_; | 287 tracking.last_interest_rect = previous_interest_rect_; |
289 tracking.invalidation_region_since_last_paint = Region(); | 288 tracking.invalidation_region_since_last_paint = Region(); |
290 } | 289 } |
291 } | 290 } |
(...skipping 988 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1280 } | 1279 } |
1281 } | 1280 } |
1282 | 1281 |
1283 // Visualize under-invalidations by overlaying the new bitmap (containing red | 1282 // Visualize under-invalidations by overlaying the new bitmap (containing red |
1284 // pixels indicating under-invalidations, and transparent pixels otherwise) | 1283 // pixels indicating under-invalidations, and transparent pixels otherwise) |
1285 // onto the painting. | 1284 // onto the painting. |
1286 PaintRecorder recorder; | 1285 PaintRecorder recorder; |
1287 recorder.beginRecording(rect); | 1286 recorder.beginRecording(rect); |
1288 recorder.getRecordingCanvas()->drawBitmap(new_bitmap, rect.X(), rect.Y()); | 1287 recorder.getRecordingCanvas()->drawBitmap(new_bitmap, rect.X(), rect.Y()); |
1289 sk_sp<PaintRecord> record = recorder.finishRecordingAsPicture(); | 1288 sk_sp<PaintRecord> record = recorder.finishRecordingAsPicture(); |
1290 GetPaintController().AppendDebugDrawingAfterCommit( | 1289 GetPaintController().AppendDebugDrawingAfterCommit(*this, record, rect); |
1291 *this, record, rect, OffsetFromLayoutObjectWithSubpixelAccumulation()); | |
1292 } | 1290 } |
1293 | 1291 |
1294 } // namespace blink | 1292 } // namespace blink |
1295 | 1293 |
1296 #ifndef NDEBUG | 1294 #ifndef NDEBUG |
1297 void showGraphicsLayerTree(const blink::GraphicsLayer* layer) { | 1295 void showGraphicsLayerTree(const blink::GraphicsLayer* layer) { |
1298 if (!layer) { | 1296 if (!layer) { |
1299 LOG(INFO) << "Cannot showGraphicsLayerTree for (nil)."; | 1297 LOG(INFO) << "Cannot showGraphicsLayerTree for (nil)."; |
1300 return; | 1298 return; |
1301 } | 1299 } |
1302 | 1300 |
1303 String output = layer->LayerTreeAsText(blink::kLayerTreeIncludesDebugInfo); | 1301 String output = layer->LayerTreeAsText(blink::kLayerTreeIncludesDebugInfo); |
1304 LOG(INFO) << output.Utf8().data(); | 1302 LOG(INFO) << output.Utf8().data(); |
1305 } | 1303 } |
1306 #endif | 1304 #endif |
OLD | NEW |