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

Side by Side Diff: sky/engine/core/frame/FrameView.cpp

Issue 711203002: Remove zoom() and effectiveZoom(). (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 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
« no previous file with comments | « sky/engine/core/frame/FrameView.h ('k') | sky/engine/core/html/HTMLImageElement.cpp » ('j') | 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) 1998, 1999 Torben Weis <weis@kde.org> 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
3 * 1999 Lars Knoll <knoll@kde.org> 3 * 1999 Lars Knoll <knoll@kde.org>
4 * 1999 Antti Koivisto <koivisto@kde.org> 4 * 1999 Antti Koivisto <koivisto@kde.org>
5 * 2000 Dirk Mueller <mueller@kde.org> 5 * 2000 Dirk Mueller <mueller@kde.org>
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com)
8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com)
9 * Copyright (C) 2009 Google Inc. All rights reserved. 9 * Copyright (C) 2009 Google Inc. All rights reserved.
10 * 10 *
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 m_layoutSchedulingEnabled = true; 120 m_layoutSchedulingEnabled = true;
121 m_inPerformLayout = false; 121 m_inPerformLayout = false;
122 m_canInvalidatePaintDuringPerformLayout = false; 122 m_canInvalidatePaintDuringPerformLayout = false;
123 m_inSynchronousPostLayout = false; 123 m_inSynchronousPostLayout = false;
124 m_layoutCount = 0; 124 m_layoutCount = 0;
125 m_nestedLayoutCount = 0; 125 m_nestedLayoutCount = 0;
126 m_postLayoutTasksTimer.stop(); 126 m_postLayoutTasksTimer.stop();
127 m_firstLayout = true; 127 m_firstLayout = true;
128 m_firstLayoutCallbackPending = false; 128 m_firstLayoutCallbackPending = false;
129 m_lastViewportSize = IntSize(); 129 m_lastViewportSize = IntSize();
130 m_lastZoomFactor = 1.0f;
131 m_isTrackingPaintInvalidations = false; 130 m_isTrackingPaintInvalidations = false;
132 m_trackedPaintInvalidationRects.clear(); 131 m_trackedPaintInvalidationRects.clear();
133 m_lastPaintTime = 0; 132 m_lastPaintTime = 0;
134 m_paintBehavior = PaintBehaviorNormal; 133 m_paintBehavior = PaintBehaviorNormal;
135 m_isPainting = false; 134 m_isPainting = false;
136 } 135 }
137 136
138 void FrameView::init() 137 void FrameView::init()
139 { 138 {
140 reset(); 139 reset();
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 TemporaryChange<bool> changeSchedulingEnabled(m_layoutSchedulingEnabled, false); 372 TemporaryChange<bool> changeSchedulingEnabled(m_layoutSchedulingEnabled, false);
374 373
375 m_nestedLayoutCount++; 374 m_nestedLayoutCount++;
376 375
377 if (!inSubtreeLayout) { 376 if (!inSubtreeLayout) {
378 if (m_firstLayout) { 377 if (m_firstLayout) {
379 m_doFullPaintInvalidation = true; 378 m_doFullPaintInvalidation = true;
380 m_firstLayout = false; 379 m_firstLayout = false;
381 m_firstLayoutCallbackPending = true; 380 m_firstLayoutCallbackPending = true;
382 m_lastViewportSize = layoutSize(IncludeScrollbars); 381 m_lastViewportSize = layoutSize(IncludeScrollbars);
383 m_lastZoomFactor = rootForThisLayout->style()->zoom();
384 } 382 }
385 383
386 m_size = LayoutSize(layoutSize().width(), layoutSize().height()); 384 m_size = LayoutSize(layoutSize().width(), layoutSize().height());
387 385
388 // We need to set m_doFullPaintInvalidation before triggering layout as RenderObject::checkForPaintInvalidation 386 // We need to set m_doFullPaintInvalidation before triggering layout as RenderObject::checkForPaintInvalidation
389 // checks the boolean to disable local paint invalidations. 387 // checks the boolean to disable local paint invalidations.
390 m_doFullPaintInvalidation |= renderView()->shouldDoFullPaintInvalida tionForNextLayout(); 388 m_doFullPaintInvalidation |= renderView()->shouldDoFullPaintInvalida tionForNextLayout();
391 } 389 }
392 390
393 layer = rootForThisLayout->enclosingLayer(); 391 layer = rootForThisLayout->enclosingLayer();
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
776 m_firstLayoutCallbackPending = false; 774 m_firstLayoutCallbackPending = false;
777 } 775 }
778 776
779 FontFaceSet::didLayout(*m_frame->document()); 777 FontFaceSet::didLayout(*m_frame->document());
780 778
781 sendResizeEventIfNeeded(); 779 sendResizeEventIfNeeded();
782 } 780 }
783 781
784 bool FrameView::wasViewportResized() 782 bool FrameView::wasViewportResized()
785 { 783 {
786 ASSERT(m_frame); 784 return layoutSize(IncludeScrollbars) != m_lastViewportSize;
787 RenderView* renderView = this->renderView();
788 if (!renderView)
789 return false;
790 return (layoutSize(IncludeScrollbars) != m_lastViewportSize || renderView->s tyle()->zoom() != m_lastZoomFactor);
791 } 785 }
792 786
793 void FrameView::sendResizeEventIfNeeded() 787 void FrameView::sendResizeEventIfNeeded()
794 { 788 {
795 ASSERT(m_frame);
796
797 RenderView* renderView = this->renderView();
798 if (!renderView)
799 return;
800
801 if (!wasViewportResized()) 789 if (!wasViewportResized())
802 return; 790 return;
803 791
804 m_lastViewportSize = layoutSize(IncludeScrollbars); 792 m_lastViewportSize = layoutSize(IncludeScrollbars);
805 m_lastZoomFactor = renderView->style()->zoom();
806
807 m_frame->document()->enqueueResizeEvent(); 793 m_frame->document()->enqueueResizeEvent();
808 } 794 }
809 795
810 void FrameView::postLayoutTimerFired(Timer<FrameView>*) 796 void FrameView::postLayoutTimerFired(Timer<FrameView>*)
811 { 797 {
812 performPostLayoutTasks(); 798 performPostLayoutTasks();
813 } 799 }
814 800
815 IntRect FrameView::windowClipRect(IncludeScrollbarsInRect scrollbarInclusion) co nst 801 IntRect FrameView::windowClipRect(IncludeScrollbarsInRect scrollbarInclusion) co nst
816 { 802 {
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
1130 void FrameView::setLayoutSizeInternal(const IntSize& size) 1116 void FrameView::setLayoutSizeInternal(const IntSize& size)
1131 { 1117 {
1132 if (m_layoutSize == size) 1118 if (m_layoutSize == size)
1133 return; 1119 return;
1134 1120
1135 m_layoutSize = size; 1121 m_layoutSize = size;
1136 contentsResized(); 1122 contentsResized();
1137 } 1123 }
1138 1124
1139 } // namespace blink 1125 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/frame/FrameView.h ('k') | sky/engine/core/html/HTMLImageElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698