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

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

Issue 11413123: cc: switch to new WebLayerTreeViewClient API for requesting font atlas (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fixing tests Created 8 years 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 // 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 "web_layer_tree_view_impl.h" 5 #include "web_layer_tree_view_impl.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 &static_cast<WebRenderingStatsImpl&>(stats).rendering_stats); 178 &static_cast<WebRenderingStatsImpl&>(stats).rendering_stats);
179 } 179 }
180 180
181 void WebLayerTreeViewImpl::setShowFPSCounter(bool show) 181 void WebLayerTreeViewImpl::setShowFPSCounter(bool show)
182 { 182 {
183 LayerTreeDebugState debugState = m_layerTreeHost->debugState(); 183 LayerTreeDebugState debugState = m_layerTreeHost->debugState();
184 debugState.showFPSCounter = show; 184 debugState.showFPSCounter = show;
185 m_layerTreeHost->setDebugState(debugState); 185 m_layerTreeHost->setDebugState(debugState);
186 } 186 }
187 187
188 void WebLayerTreeViewImpl::setFontAtlas(SkBitmap bitmap, WebRect asciiToWebRectT able[128], int fontHeight) { 188 scoped_ptr<FontAtlas> WebLayerTreeViewImpl::createFontAtlas()
189 setFontAtlas(asciiToWebRectTable, bitmap, fontHeight); 189 {
190 } 190 int fontHeight;
191 WebRect asciiToWebRectTable[128];
192 gfx::Rect asciiToRectTable[128];
193 SkBitmap bitmap;
191 194
192 void WebLayerTreeViewImpl::setFontAtlas(WebRect asciiToWebRectTable[128], const SkBitmap& bitmap, int fontHeight) 195 m_client->createFontAtlas(bitmap, asciiToWebRectTable, fontHeight);
193 { 196
194 gfx::Rect asciiToRectTable[128];
195 for (int i = 0; i < 128; ++i) 197 for (int i = 0; i < 128; ++i)
196 asciiToRectTable[i] = asciiToWebRectTable[i]; 198 asciiToRectTable[i] = asciiToWebRectTable[i];
197 scoped_ptr<FontAtlas> fontAtlas = FontAtlas::create(bitmap, asciiToRectTable , fontHeight); 199
198 m_layerTreeHost->setFontAtlas(fontAtlas.Pass()); 200 return FontAtlas::create(bitmap, asciiToRectTable, fontHeight).Pass();
199 } 201 }
200 202
201 void WebLayerTreeViewImpl::loseCompositorContext(int numTimes) 203 void WebLayerTreeViewImpl::loseCompositorContext(int numTimes)
202 { 204 {
203 m_layerTreeHost->loseContext(numTimes); 205 m_layerTreeHost->loseContext(numTimes);
204 } 206 }
205 207
206 void WebLayerTreeViewImpl::willBeginFrame() 208 void WebLayerTreeViewImpl::willBeginFrame()
207 { 209 {
208 m_client->willBeginFrame(); 210 m_client->willBeginFrame();
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 { 268 {
267 m_client->didCompleteSwapBuffers(); 269 m_client->didCompleteSwapBuffers();
268 } 270 }
269 271
270 void WebLayerTreeViewImpl::scheduleComposite() 272 void WebLayerTreeViewImpl::scheduleComposite()
271 { 273 {
272 m_client->scheduleComposite(); 274 m_client->scheduleComposite();
273 } 275 }
274 276
275 } // namespace WebKit 277 } // namespace WebKit
OLDNEW
« cc/layer_tree_host.cc ('K') | « webkit/compositor_bindings/web_layer_tree_view_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698