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

Side by Side Diff: webkit/compositor_bindings/web_layer_tree_view_impl.cc

Issue 11264056: cc: Use gfx:: Geometry types for positions, bounds, and related things. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ScaleAsVector Created 8 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 | Annotate | Revision Log
« no previous file with comments | « webkit/compositor_bindings/web_layer_impl.cc ('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 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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 #include "web_layer_tree_view_impl.h" 6 #include "web_layer_tree_view_impl.h"
7 7
8 #include "cc/font_atlas.h" 8 #include "cc/font_atlas.h"
9 #include "cc/input_handler.h" 9 #include "cc/input_handler.h"
10 #include "cc/layer.h" 10 #include "cc/layer.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 44
45 bool WebLayerTreeViewImpl::initialize(const WebLayerTreeView::Settings& webSetti ngs) 45 bool WebLayerTreeViewImpl::initialize(const WebLayerTreeView::Settings& webSetti ngs)
46 { 46 {
47 LayerTreeSettings settings; 47 LayerTreeSettings settings;
48 settings.acceleratePainting = webSettings.acceleratePainting; 48 settings.acceleratePainting = webSettings.acceleratePainting;
49 settings.showFPSCounter = webSettings.showFPSCounter; 49 settings.showFPSCounter = webSettings.showFPSCounter;
50 settings.showPlatformLayerTree = webSettings.showPlatformLayerTree; 50 settings.showPlatformLayerTree = webSettings.showPlatformLayerTree;
51 settings.showPaintRects = webSettings.showPaintRects; 51 settings.showPaintRects = webSettings.showPaintRects;
52 settings.renderVSyncEnabled = webSettings.renderVSyncEnabled; 52 settings.renderVSyncEnabled = webSettings.renderVSyncEnabled;
53 settings.refreshRate = webSettings.refreshRate; 53 settings.refreshRate = webSettings.refreshRate;
54 settings.defaultTileSize = convert(webSettings.defaultTileSize); 54 settings.defaultTileSize = webSettings.defaultTileSize;
55 settings.maxUntiledLayerSize = convert(webSettings.maxUntiledLayerSize); 55 settings.maxUntiledLayerSize = webSettings.maxUntiledLayerSize;
56 m_layerTreeHost = LayerTreeHost::create(this, settings); 56 m_layerTreeHost = LayerTreeHost::create(this, settings);
57 if (!m_layerTreeHost.get()) 57 if (!m_layerTreeHost.get())
58 return false; 58 return false;
59 return true; 59 return true;
60 } 60 }
61 61
62 void WebLayerTreeViewImpl::setSurfaceReady() 62 void WebLayerTreeViewImpl::setSurfaceReady()
63 { 63 {
64 m_layerTreeHost->setSurfaceReady(); 64 m_layerTreeHost->setSurfaceReady();
65 } 65 }
66 66
67 void WebLayerTreeViewImpl::setRootLayer(const WebLayer& root) 67 void WebLayerTreeViewImpl::setRootLayer(const WebLayer& root)
68 { 68 {
69 m_layerTreeHost->setRootLayer(static_cast<const WebLayerImpl*>(&root)->layer ()); 69 m_layerTreeHost->setRootLayer(static_cast<const WebLayerImpl*>(&root)->layer ());
70 } 70 }
71 71
72 void WebLayerTreeViewImpl::clearRootLayer() 72 void WebLayerTreeViewImpl::clearRootLayer()
73 { 73 {
74 m_layerTreeHost->setRootLayer(scoped_refptr<Layer>()); 74 m_layerTreeHost->setRootLayer(scoped_refptr<Layer>());
75 } 75 }
76 76
77 void WebLayerTreeViewImpl::setViewportSize(const WebSize& layoutViewportSize, co nst WebSize& deviceViewportSize) 77 void WebLayerTreeViewImpl::setViewportSize(const WebSize& layoutViewportSize, co nst WebSize& deviceViewportSize)
78 { 78 {
79 if (!deviceViewportSize.isEmpty()) 79 if (!deviceViewportSize.isEmpty())
80 m_layerTreeHost->setViewportSize(convert(layoutViewportSize), convert(de viceViewportSize)); 80 m_layerTreeHost->setViewportSize(layoutViewportSize, deviceViewportSize) ;
81 else 81 else
82 m_layerTreeHost->setViewportSize(convert(layoutViewportSize), convert(la youtViewportSize)); 82 m_layerTreeHost->setViewportSize(layoutViewportSize, layoutViewportSize) ;
83 } 83 }
84 84
85 WebSize WebLayerTreeViewImpl::layoutViewportSize() const 85 WebSize WebLayerTreeViewImpl::layoutViewportSize() const
86 { 86 {
87 return convert(m_layerTreeHost->layoutViewportSize()); 87 return m_layerTreeHost->layoutViewportSize();
88 } 88 }
89 89
90 WebSize WebLayerTreeViewImpl::deviceViewportSize() const 90 WebSize WebLayerTreeViewImpl::deviceViewportSize() const
91 { 91 {
92 return convert(m_layerTreeHost->deviceViewportSize()); 92 return m_layerTreeHost->deviceViewportSize();
93 } 93 }
94 94
95 WebFloatPoint WebLayerTreeViewImpl::adjustEventPointForPinchZoom(const WebFloatP oint& point) const 95 WebFloatPoint WebLayerTreeViewImpl::adjustEventPointForPinchZoom(const WebFloatP oint& point) const
96 { 96 {
97 return convert(m_layerTreeHost->adjustEventPointForPinchZoom(convert(point)) ); 97 return m_layerTreeHost->adjustEventPointForPinchZoom(point);
98 } 98 }
99 99
100 void WebLayerTreeViewImpl::setDeviceScaleFactor(const float deviceScaleFactor) 100 void WebLayerTreeViewImpl::setDeviceScaleFactor(const float deviceScaleFactor)
101 { 101 {
102 m_layerTreeHost->setDeviceScaleFactor(deviceScaleFactor); 102 m_layerTreeHost->setDeviceScaleFactor(deviceScaleFactor);
103 } 103 }
104 104
105 float WebLayerTreeViewImpl::deviceScaleFactor() const 105 float WebLayerTreeViewImpl::deviceScaleFactor() const
106 { 106 {
107 return m_layerTreeHost->deviceScaleFactor(); 107 return m_layerTreeHost->deviceScaleFactor();
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 stats.totalPaintTimeInSeconds = ccStats.totalPaintTimeInSeconds; 188 stats.totalPaintTimeInSeconds = ccStats.totalPaintTimeInSeconds;
189 stats.totalRasterizeTimeInSeconds = ccStats.totalRasterizeTimeInSeconds; 189 stats.totalRasterizeTimeInSeconds = ccStats.totalRasterizeTimeInSeconds;
190 stats.totalCommitTimeInSeconds = ccStats.totalCommitTimeInSeconds; 190 stats.totalCommitTimeInSeconds = ccStats.totalCommitTimeInSeconds;
191 stats.totalCommitCount = ccStats.totalCommitCount; 191 stats.totalCommitCount = ccStats.totalCommitCount;
192 stats.numImplThreadScrolls = ccStats.numImplThreadScrolls; 192 stats.numImplThreadScrolls = ccStats.numImplThreadScrolls;
193 stats.numMainThreadScrolls = ccStats.numMainThreadScrolls; 193 stats.numMainThreadScrolls = ccStats.numMainThreadScrolls;
194 } 194 }
195 195
196 void WebLayerTreeViewImpl::setFontAtlas(SkBitmap bitmap, WebRect asciiToWebRectT able[128], int fontHeight) 196 void WebLayerTreeViewImpl::setFontAtlas(SkBitmap bitmap, WebRect asciiToWebRectT able[128], int fontHeight)
197 { 197 {
198 IntRect asciiToRectTable[128]; 198 gfx::Rect asciiToRectTable[128];
199 for (int i = 0; i < 128; ++i) 199 for (int i = 0; i < 128; ++i)
200 asciiToRectTable[i] = convert(asciiToWebRectTable[i]); 200 asciiToRectTable[i] = asciiToWebRectTable[i];
201 scoped_ptr<FontAtlas> fontAtlas = FontAtlas::create(bitmap, asciiToRectTable , fontHeight); 201 scoped_ptr<FontAtlas> fontAtlas = FontAtlas::create(bitmap, asciiToRectTable , fontHeight);
202 m_layerTreeHost->setFontAtlas(fontAtlas.Pass()); 202 m_layerTreeHost->setFontAtlas(fontAtlas.Pass());
203 } 203 }
204 204
205 void WebLayerTreeViewImpl::loseCompositorContext(int numTimes) 205 void WebLayerTreeViewImpl::loseCompositorContext(int numTimes)
206 { 206 {
207 m_layerTreeHost->loseContext(numTimes); 207 m_layerTreeHost->loseContext(numTimes);
208 } 208 }
209 209
210 void WebLayerTreeViewImpl::willBeginFrame() 210 void WebLayerTreeViewImpl::willBeginFrame()
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 { 270 {
271 m_client->didCompleteSwapBuffers(); 271 m_client->didCompleteSwapBuffers();
272 } 272 }
273 273
274 void WebLayerTreeViewImpl::scheduleComposite() 274 void WebLayerTreeViewImpl::scheduleComposite()
275 { 275 {
276 m_client->scheduleComposite(); 276 m_client->scheduleComposite();
277 } 277 }
278 278
279 } // namespace WebKit 279 } // namespace WebKit
OLDNEW
« no previous file with comments | « webkit/compositor_bindings/web_layer_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698