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

Side by Side Diff: third_party/WebKit/Source/web/LinkHighlightImpl.cpp

Issue 2872423002: Tweak PaintInvalidationReasons (Closed)
Patch Set: Rebaseline-cl Created 3 years, 7 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 | « third_party/WebKit/Source/platform/graphics/paint/RasterInvalidationTracking.h ('k') | 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 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google 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 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 if (has_layout_object) { 369 if (has_layout_object) {
370 const LayoutBoxModelObject& paint_invalidation_container = 370 const LayoutBoxModelObject& paint_invalidation_container =
371 node_->GetLayoutObject()->ContainerForPaintInvalidation(); 371 node_->GetLayoutObject()->ContainerForPaintInvalidation();
372 AttachLinkHighlightToCompositingLayer(paint_invalidation_container); 372 AttachLinkHighlightToCompositingLayer(paint_invalidation_container);
373 if (ComputeHighlightLayerPathAndPosition(paint_invalidation_container)) { 373 if (ComputeHighlightLayerPathAndPosition(paint_invalidation_container)) {
374 // We only need to invalidate the layer if the highlight size has changed, 374 // We only need to invalidate the layer if the highlight size has changed,
375 // otherwise we can just re-position the layer without needing to 375 // otherwise we can just re-position the layer without needing to
376 // repaint. 376 // repaint.
377 content_layer_->Layer()->Invalidate(); 377 content_layer_->Layer()->Invalidate();
378 378
379 if (current_graphics_layer_) 379 if (current_graphics_layer_) {
380 current_graphics_layer_->TrackRasterInvalidation( 380 current_graphics_layer_->TrackRasterInvalidation(
381 LinkHighlightDisplayItemClientForTracking(), 381 LinkHighlightDisplayItemClientForTracking(),
382 EnclosingIntRect( 382 EnclosingIntRect(
383 FloatRect(Layer()->GetPosition().x, Layer()->GetPosition().y, 383 FloatRect(Layer()->GetPosition().x, Layer()->GetPosition().y,
384 Layer()->Bounds().width, Layer()->Bounds().height)), 384 Layer()->Bounds().width, Layer()->Bounds().height)),
385 kPaintInvalidationFull); 385 PaintInvalidationReason::kFull);
386 }
386 } 387 }
387 } else { 388 } else {
388 ClearGraphicsLayerLinkHighlightPointer(); 389 ClearGraphicsLayerLinkHighlightPointer();
389 ReleaseResources(); 390 ReleaseResources();
390 } 391 }
391 } 392 }
392 393
393 void LinkHighlightImpl::ClearCurrentGraphicsLayer() { 394 void LinkHighlightImpl::ClearCurrentGraphicsLayer() {
394 current_graphics_layer_ = 0; 395 current_graphics_layer_ = 0;
395 geometry_needs_update_ = true; 396 geometry_needs_update_ = true;
396 } 397 }
397 398
398 void LinkHighlightImpl::Invalidate() { 399 void LinkHighlightImpl::Invalidate() {
399 // Make sure we update geometry on the next callback from 400 // Make sure we update geometry on the next callback from
400 // WebViewImpl::layout(). 401 // WebViewImpl::layout().
401 geometry_needs_update_ = true; 402 geometry_needs_update_ = true;
402 } 403 }
403 404
404 WebLayer* LinkHighlightImpl::Layer() { 405 WebLayer* LinkHighlightImpl::Layer() {
405 return ClipLayer(); 406 return ClipLayer();
406 } 407 }
407 408
408 CompositorAnimationPlayer* LinkHighlightImpl::CompositorPlayer() const { 409 CompositorAnimationPlayer* LinkHighlightImpl::CompositorPlayer() const {
409 return compositor_player_.get(); 410 return compositor_player_.get();
410 } 411 }
411 412
412 } // namespace blink 413 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/paint/RasterInvalidationTracking.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698