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