| 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()); |
| 281 if (RuntimeEnabledFeatures::paintUnderInvalidationCheckingEnabled()) { | 282 if (RuntimeEnabledFeatures::paintUnderInvalidationCheckingEnabled()) { |
| 282 sk_sp<PaintRecord> record = CaptureRecord(); | 283 sk_sp<PaintRecord> record = CaptureRecord(); |
| 283 CheckPaintUnderInvalidations(record); | 284 CheckPaintUnderInvalidations(record); |
| 284 RasterInvalidationTracking& tracking = | 285 RasterInvalidationTracking& tracking = |
| 285 GetRasterInvalidationTrackingMap().Add(this); | 286 GetRasterInvalidationTrackingMap().Add(this); |
| 286 tracking.last_painted_record = std::move(record); | 287 tracking.last_painted_record = std::move(record); |
| 287 tracking.last_interest_rect = previous_interest_rect_; | 288 tracking.last_interest_rect = previous_interest_rect_; |
| 288 tracking.invalidation_region_since_last_paint = Region(); | 289 tracking.invalidation_region_since_last_paint = Region(); |
| 289 } | 290 } |
| 290 } | 291 } |
| (...skipping 983 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1274 } | 1275 } |
| 1275 } | 1276 } |
| 1276 | 1277 |
| 1277 // Visualize under-invalidations by overlaying the new bitmap (containing red | 1278 // Visualize under-invalidations by overlaying the new bitmap (containing red |
| 1278 // pixels indicating under-invalidations, and transparent pixels otherwise) | 1279 // pixels indicating under-invalidations, and transparent pixels otherwise) |
| 1279 // onto the painting. | 1280 // onto the painting. |
| 1280 PaintRecorder recorder; | 1281 PaintRecorder recorder; |
| 1281 recorder.beginRecording(rect); | 1282 recorder.beginRecording(rect); |
| 1282 recorder.getRecordingCanvas()->drawBitmap(new_bitmap, rect.X(), rect.Y()); | 1283 recorder.getRecordingCanvas()->drawBitmap(new_bitmap, rect.X(), rect.Y()); |
| 1283 sk_sp<PaintRecord> record = recorder.finishRecordingAsPicture(); | 1284 sk_sp<PaintRecord> record = recorder.finishRecordingAsPicture(); |
| 1284 GetPaintController().AppendDebugDrawingAfterCommit(*this, record); | 1285 GetPaintController().AppendDebugDrawingAfterCommit( |
| 1286 *this, record, OffsetFromLayoutObjectWithSubpixelAccumulation()); |
| 1285 } | 1287 } |
| 1286 | 1288 |
| 1287 } // namespace blink | 1289 } // namespace blink |
| 1288 | 1290 |
| 1289 #ifndef NDEBUG | 1291 #ifndef NDEBUG |
| 1290 void showGraphicsLayerTree(const blink::GraphicsLayer* layer) { | 1292 void showGraphicsLayerTree(const blink::GraphicsLayer* layer) { |
| 1291 if (!layer) { | 1293 if (!layer) { |
| 1292 LOG(INFO) << "Cannot showGraphicsLayerTree for (nil)."; | 1294 LOG(INFO) << "Cannot showGraphicsLayerTree for (nil)."; |
| 1293 return; | 1295 return; |
| 1294 } | 1296 } |
| 1295 | 1297 |
| 1296 String output = layer->LayerTreeAsText(blink::kLayerTreeIncludesDebugInfo); | 1298 String output = layer->LayerTreeAsText(blink::kLayerTreeIncludesDebugInfo); |
| 1297 LOG(INFO) << output.Utf8().data(); | 1299 LOG(INFO) << output.Utf8().data(); |
| 1298 } | 1300 } |
| 1299 #endif | 1301 #endif |
| OLD | NEW |