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

Side by Side Diff: third_party/WebKit/Source/core/paint/ObjectPaintInvalidator.cpp

Issue 2809563003: Null check view during paint invalidation (Closed)
Patch Set: Created 3 years, 8 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/paint/ObjectPaintInvalidator.h" 5 #include "core/paint/ObjectPaintInvalidator.h"
6 6
7 #include "core/frame/FrameView.h" 7 #include "core/frame/FrameView.h"
8 #include "core/frame/LocalFrame.h" 8 #include "core/frame/LocalFrame.h"
9 #include "core/layout/LayoutView.h" 9 #include "core/layout/LayoutView.h"
10 #include "core/layout/api/LayoutPartItem.h" 10 #include "core/layout/api/LayoutPartItem.h"
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 JsonObjectForPaintInvalidationInfo( 375 JsonObjectForPaintInvalidationInfo(
376 dirty_rect, PaintInvalidationReasonToString(invalidation_reason))); 376 dirty_rect, PaintInvalidationReasonToString(invalidation_reason)));
377 377
378 // This conditional handles situations where non-rooted (and hence 378 // This conditional handles situations where non-rooted (and hence
379 // non-composited) frames are painted, such as SVG images. 379 // non-composited) frames are painted, such as SVG images.
380 if (!paint_invalidation_container.IsPaintInvalidationContainer()) { 380 if (!paint_invalidation_container.IsPaintInvalidationContainer()) {
381 InvalidatePaintRectangleOnWindow(paint_invalidation_container, 381 InvalidatePaintRectangleOnWindow(paint_invalidation_container,
382 EnclosingIntRect(dirty_rect)); 382 EnclosingIntRect(dirty_rect));
383 } 383 }
384 384
385 if (paint_invalidation_container.View()->UsesCompositing() && 385 auto* view = paint_invalidation_container.View();
386 paint_invalidation_container.IsPaintInvalidationContainer()) { 386 if (view && view->UsesCompositing()) {
387 SetBackingNeedsPaintInvalidationInRect(paint_invalidation_container, 387 if (paint_invalidation_container.IsPaintInvalidationContainer()) {
388 dirty_rect, invalidation_reason); 388 SetBackingNeedsPaintInvalidationInRect(paint_invalidation_container,
389 dirty_rect, invalidation_reason);
390 }
389 } 391 }
390 } 392 }
391 393
392 LayoutRect ObjectPaintInvalidator::InvalidatePaintRectangle( 394 LayoutRect ObjectPaintInvalidator::InvalidatePaintRectangle(
393 const LayoutRect& dirty_rect, 395 const LayoutRect& dirty_rect,
394 DisplayItemClient* display_item_client) { 396 DisplayItemClient* display_item_client) {
395 CHECK(object_.IsRooted()); 397 CHECK(object_.IsRooted());
396 398
397 if (dirty_rect.IsEmpty()) 399 if (dirty_rect.IsEmpty())
398 return LayoutRect(); 400 return LayoutRect();
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
664 666
665 context_.painting_layer->SetNeedsRepaint(); 667 context_.painting_layer->SetNeedsRepaint();
666 object_.InvalidateDisplayItemClients(reason); 668 object_.InvalidateDisplayItemClients(reason);
667 return reason; 669 return reason;
668 } 670 }
669 671
670 DisablePaintInvalidationStateAsserts::DisablePaintInvalidationStateAsserts() 672 DisablePaintInvalidationStateAsserts::DisablePaintInvalidationStateAsserts()
671 : disabler_(&g_disable_paint_invalidation_state_asserts, true) {} 673 : disabler_(&g_disable_paint_invalidation_state_asserts, true) {}
672 674
673 } // namespace blink 675 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698