Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Side by Side Diff: third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp

Issue 2423513002: Simplify incremental paint invalidation (Closed)
Patch Set: Test Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 499 matching lines...) Expand 10 before | Expand all | Expand 10 after
510 if (!tracking) 510 if (!tracking)
511 return; 511 return;
512 512
513 if (RuntimeEnabledFeatures::paintUnderInvalidationCheckingEnabled()) 513 if (RuntimeEnabledFeatures::paintUnderInvalidationCheckingEnabled())
514 tracking->trackedRasterInvalidations.clear(); 514 tracking->trackedRasterInvalidations.clear();
515 else 515 else
516 rasterInvalidationTrackingMap().remove(this); 516 rasterInvalidationTrackingMap().remove(this);
517 } 517 }
518 518
519 bool GraphicsLayer::hasTrackedRasterInvalidations() const { 519 bool GraphicsLayer::hasTrackedRasterInvalidations() const {
520 RasterInvalidationTracking* tracking = 520 if (auto* tracking = getRasterInvalidationTracking())
521 rasterInvalidationTrackingMap().find(this);
522 if (tracking)
523 return !tracking->trackedRasterInvalidations.isEmpty(); 521 return !tracking->trackedRasterInvalidations.isEmpty();
524 return false; 522 return false;
525 } 523 }
526 524
525 const RasterInvalidationTracking* GraphicsLayer::getRasterInvalidationTracking()
526 const {
527 return rasterInvalidationTrackingMap().find(this);
528 }
529
527 void GraphicsLayer::trackRasterInvalidation(const DisplayItemClient& client, 530 void GraphicsLayer::trackRasterInvalidation(const DisplayItemClient& client,
528 const IntRect& rect, 531 const IntRect& rect,
529 PaintInvalidationReason reason) { 532 PaintInvalidationReason reason) {
530 if (!isTrackingOrCheckingRasterInvalidations() || rect.isEmpty()) 533 if (!isTrackingOrCheckingRasterInvalidations() || rect.isEmpty())
531 return; 534 return;
532 535
533 RasterInvalidationTracking& tracking = 536 RasterInvalidationTracking& tracking =
534 rasterInvalidationTrackingMap().add(this); 537 rasterInvalidationTrackingMap().add(this);
535 538
536 if (m_isTrackingRasterInvalidations) { 539 if (m_isTrackingRasterInvalidations) {
(...skipping 753 matching lines...) Expand 10 before | Expand all | Expand 10 after
1290 void showGraphicsLayerTree(const blink::GraphicsLayer* layer) { 1293 void showGraphicsLayerTree(const blink::GraphicsLayer* layer) {
1291 if (!layer) { 1294 if (!layer) {
1292 fprintf(stderr, "Cannot showGraphicsLayerTree for (nil).\n"); 1295 fprintf(stderr, "Cannot showGraphicsLayerTree for (nil).\n");
1293 return; 1296 return;
1294 } 1297 }
1295 1298
1296 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo); 1299 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo);
1297 fprintf(stderr, "%s\n", output.utf8().data()); 1300 fprintf(stderr, "%s\n", output.utf8().data());
1298 } 1301 }
1299 #endif 1302 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698