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

Side by Side Diff: cc/LayerChromium.cpp

Issue 10909255: Support high DPI scrollbar on top level web frame. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Only apply page scale factor to layers within and including root scroll layer. Created 8 years, 3 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2010 The Chromium Authors. All rights reserved. 1 // Copyright 2010 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 "config.h" 5 #include "config.h"
6 6
7 #if USE(ACCELERATED_COMPOSITING) 7 #if USE(ACCELERATED_COMPOSITING)
8 #include "LayerChromium.h" 8 #include "LayerChromium.h"
9 9
10 #include "CCActiveAnimation.h" 10 #include "CCActiveAnimation.h"
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 if (host && m_layerAnimationController->hasActiveAnimation()) 109 if (host && m_layerAnimationController->hasActiveAnimation())
110 host->didAddAnimation(); 110 host->didAddAnimation();
111 } 111 }
112 112
113 void LayerChromium::setNeedsCommit() 113 void LayerChromium::setNeedsCommit()
114 { 114 {
115 if (m_layerTreeHost) 115 if (m_layerTreeHost)
116 m_layerTreeHost->setNeedsCommit(); 116 m_layerTreeHost->setNeedsCommit();
117 } 117 }
118 118
119 IntRect LayerChromium::layerRectToContentRect(const WebKit::WebRect& layerRect)
120 {
121 float widthScale = static_cast<float>(contentBounds().width()) / bounds().wi dth();
122 float heightScale = static_cast<float>(contentBounds().height()) / bounds(). height();
123 FloatRect contentRect(layerRect.x, layerRect.y, layerRect.width, layerRect.h eight);
124 contentRect.scale(widthScale, heightScale);
125 return enclosingIntRect(contentRect);
126 }
127
119 void LayerChromium::setParent(LayerChromium* layer) 128 void LayerChromium::setParent(LayerChromium* layer)
120 { 129 {
121 ASSERT(!layer || !layer->hasAncestor(this)); 130 ASSERT(!layer || !layer->hasAncestor(this));
122 m_parent = layer; 131 m_parent = layer;
123 setLayerTreeHost(m_parent ? m_parent->layerTreeHost() : 0); 132 setLayerTreeHost(m_parent ? m_parent->layerTreeHost() : 0);
124 } 133 }
125 134
126 bool LayerChromium::hasAncestor(LayerChromium* ancestor) const 135 bool LayerChromium::hasAncestor(LayerChromium* ancestor) const
127 { 136 {
128 for (LayerChromium* layer = parent(); layer; layer = layer->parent()) { 137 for (LayerChromium* layer = parent(); layer; layer = layer->parent()) {
(...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after
721 return Region(); 730 return Region();
722 } 731 }
723 732
724 void sortLayers(Vector<RefPtr<LayerChromium> >::iterator, Vector<RefPtr<LayerChr omium> >::iterator, void*) 733 void sortLayers(Vector<RefPtr<LayerChromium> >::iterator, Vector<RefPtr<LayerChr omium> >::iterator, void*)
725 { 734 {
726 // Currently we don't use z-order to decide what to paint, so there's no nee d to actually sort LayerChromiums. 735 // Currently we don't use z-order to decide what to paint, so there's no nee d to actually sort LayerChromiums.
727 } 736 }
728 737
729 } 738 }
730 #endif // USE(ACCELERATED_COMPOSITING) 739 #endif // USE(ACCELERATED_COMPOSITING)
OLDNEW
« cc/CCLayerTreeHost.cpp ('K') | « cc/LayerChromium.h ('k') | cc/ScrollbarLayerChromium.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698