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

Side by Side Diff: third_party/WebKit/Source/core/frame/VisualViewport.cpp

Issue 1441973003: Use recomputed interest rect only if it changed enough (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix release builds Created 5 years, 1 month 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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after
572 GraphicsLayer* VisualViewport::layerForHorizontalScrollbar() const 572 GraphicsLayer* VisualViewport::layerForHorizontalScrollbar() const
573 { 573 {
574 return m_overlayScrollbarHorizontal.get(); 574 return m_overlayScrollbarHorizontal.get();
575 } 575 }
576 576
577 GraphicsLayer* VisualViewport::layerForVerticalScrollbar() const 577 GraphicsLayer* VisualViewport::layerForVerticalScrollbar() const
578 { 578 {
579 return m_overlayScrollbarVertical.get(); 579 return m_overlayScrollbarVertical.get();
580 } 580 }
581 581
582 void VisualViewport::paintContents(const GraphicsLayer*, GraphicsContext&, Graph icsLayerPaintingPhase, const IntRect* inClip) const 582 IntRect VisualViewport::computeInterestRect(const GraphicsLayer*, const IntRect& ) const
583 {
584 return IntRect();
585 }
586
587 void VisualViewport::paintContents(const GraphicsLayer*, GraphicsContext&, Graph icsLayerPaintingPhase, const IntRect&) const
583 { 588 {
584 } 589 }
585 590
586 LocalFrame* VisualViewport::mainFrame() const 591 LocalFrame* VisualViewport::mainFrame() const
587 { 592 {
588 return frameHost().page().mainFrame() && frameHost().page().mainFrame()->isL ocalFrame() ? frameHost().page().deprecatedLocalMainFrame() : 0; 593 return frameHost().page().mainFrame() && frameHost().page().mainFrame()->isL ocalFrame() ? frameHost().page().deprecatedLocalMainFrame() : 0;
589 } 594 }
590 595
591 FloatPoint VisualViewport::clampOffsetToBoundaries(const FloatPoint& offset) 596 FloatPoint VisualViewport::clampOffsetToBoundaries(const FloatPoint& offset)
592 { 597 {
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
712 // A document is considered adapted to small screen UAs if one of these hold s: 717 // A document is considered adapted to small screen UAs if one of these hold s:
713 // 1. The author specified viewport has a constrained width that is equal to 718 // 1. The author specified viewport has a constrained width that is equal to
714 // the initial viewport width. 719 // the initial viewport width.
715 // 2. The author has disabled viewport zoom. 720 // 2. The author has disabled viewport zoom.
716 const PageScaleConstraints& constraints = frameHost().pageScaleConstraintsSe t().pageDefinedConstraints(); 721 const PageScaleConstraints& constraints = frameHost().pageScaleConstraintsSe t().pageDefinedConstraints();
717 722
718 return mainFrame()->view()->layoutSize().width() == m_size.width() 723 return mainFrame()->view()->layoutSize().width() == m_size.width()
719 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1); 724 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1);
720 } 725 }
721 726
722 String VisualViewport::debugName(const GraphicsLayer* graphicsLayer) 727 String VisualViewport::debugName(const GraphicsLayer* graphicsLayer) const
723 { 728 {
724 String name; 729 String name;
725 if (graphicsLayer == m_innerViewportContainerLayer.get()) { 730 if (graphicsLayer == m_innerViewportContainerLayer.get()) {
726 name = "Inner Viewport Container Layer"; 731 name = "Inner Viewport Container Layer";
727 } else if (graphicsLayer == m_overscrollElasticityLayer.get()) { 732 } else if (graphicsLayer == m_overscrollElasticityLayer.get()) {
728 name = "Overscroll Elasticity Layer"; 733 name = "Overscroll Elasticity Layer";
729 } else if (graphicsLayer == m_pageScaleLayer.get()) { 734 } else if (graphicsLayer == m_pageScaleLayer.get()) {
730 name = "Page Scale Layer"; 735 name = "Page Scale Layer";
731 } else if (graphicsLayer == m_innerViewportScrollLayer.get()) { 736 } else if (graphicsLayer == m_innerViewportScrollLayer.get()) {
732 name = "Inner Viewport Scroll Layer"; 737 name = "Inner Viewport Scroll Layer";
733 } else if (graphicsLayer == m_overlayScrollbarHorizontal.get()) { 738 } else if (graphicsLayer == m_overlayScrollbarHorizontal.get()) {
734 name = "Overlay Scrollbar Horizontal Layer"; 739 name = "Overlay Scrollbar Horizontal Layer";
735 } else if (graphicsLayer == m_overlayScrollbarVertical.get()) { 740 } else if (graphicsLayer == m_overlayScrollbarVertical.get()) {
736 name = "Overlay Scrollbar Vertical Layer"; 741 name = "Overlay Scrollbar Vertical Layer";
737 } else if (graphicsLayer == m_rootTransformLayer) { 742 } else if (graphicsLayer == m_rootTransformLayer) {
738 name = "Root Transform Layer"; 743 name = "Root Transform Layer";
739 } else { 744 } else {
740 ASSERT_NOT_REACHED(); 745 ASSERT_NOT_REACHED();
741 } 746 }
742 747
743 return name; 748 return name;
744 } 749 }
745 750
746 } // namespace blink 751 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698