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

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: fixed WebKit tests for patch #1 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
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 "cc/font_atlas.h" 7 #include "cc/font_atlas.h"
8 #include "cc/input_handler.h" 8 #include "cc/input_handler.h"
9 #include "cc/layer.h" 9 #include "cc/layer.h"
10 #include "cc/layer_tree_host.h" 10 #include "cc/layer_tree_host.h"
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 stats.totalPixelsRasterized = ccStats.totalPixelsRasterized; 186 stats.totalPixelsRasterized = ccStats.totalPixelsRasterized;
187 stats.numImplThreadScrolls = ccStats.numImplThreadScrolls; 187 stats.numImplThreadScrolls = ccStats.numImplThreadScrolls;
188 stats.numMainThreadScrolls = ccStats.numMainThreadScrolls; 188 stats.numMainThreadScrolls = ccStats.numMainThreadScrolls;
189 } 189 }
190 190
191 void WebLayerTreeViewImpl::setShowFPSCounter(bool show) 191 void WebLayerTreeViewImpl::setShowFPSCounter(bool show)
192 { 192 {
193 m_layerTreeHost->setShowFPSCounter(show); 193 m_layerTreeHost->setShowFPSCounter(show);
194 } 194 }
195 195
196 void WebLayerTreeViewImpl::setFontAtlas(SkBitmap bitmap, WebRect asciiToWebRectT able[128], int fontHeight) { 196 scoped_ptr<FontAtlas> WebLayerTreeViewImpl::createFontAtlas()
197 setFontAtlas(asciiToWebRectTable, bitmap, fontHeight); 197 {
198 } 198 int fontHeight;
199 WebRect asciiToWebRectTable[128];
200 gfx::Rect asciiToRectTable[128];
201 SkBitmap bitmap;
199 202
200 void WebLayerTreeViewImpl::setFontAtlas(WebRect asciiToWebRectTable[128], const SkBitmap& bitmap, int fontHeight) 203 m_client->createFontAtlas(bitmap, asciiToWebRectTable, fontHeight);
201 { 204
202 gfx::Rect asciiToRectTable[128];
203 for (int i = 0; i < 128; ++i) 205 for (int i = 0; i < 128; ++i)
204 asciiToRectTable[i] = asciiToWebRectTable[i]; 206 asciiToRectTable[i] = asciiToWebRectTable[i];
205 scoped_ptr<FontAtlas> fontAtlas = FontAtlas::create(bitmap, asciiToRectTable , fontHeight); 207
206 m_layerTreeHost->setFontAtlas(fontAtlas.Pass()); 208 return FontAtlas::create(bitmap, asciiToRectTable, fontHeight).Pass();
207 } 209 }
208 210
209 void WebLayerTreeViewImpl::loseCompositorContext(int numTimes) 211 void WebLayerTreeViewImpl::loseCompositorContext(int numTimes)
210 { 212 {
211 m_layerTreeHost->loseContext(numTimes); 213 m_layerTreeHost->loseContext(numTimes);
212 } 214 }
213 215
214 void WebLayerTreeViewImpl::willBeginFrame() 216 void WebLayerTreeViewImpl::willBeginFrame()
215 { 217 {
216 m_client->willBeginFrame(); 218 m_client->willBeginFrame();
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 { 276 {
275 m_client->didCompleteSwapBuffers(); 277 m_client->didCompleteSwapBuffers();
276 } 278 }
277 279
278 void WebLayerTreeViewImpl::scheduleComposite() 280 void WebLayerTreeViewImpl::scheduleComposite()
279 { 281 {
280 m_client->scheduleComposite(); 282 m_client->scheduleComposite();
281 } 283 }
282 284
283 } // namespace WebKit 285 } // namespace WebKit
OLDNEW
« cc/layer_tree_host_client.h ('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