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

Side by Side Diff: content/browser/gpu/gpu_process_host_ui_shim.cc

Issue 8772031: Add a JS API for detecting WebGL availability. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 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 | Annotate | Revision Log
« no previous file with comments | « content/browser/gpu/gpu_process_host_ui_shim.h ('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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "content/browser/gpu/gpu_process_host_ui_shim.h" 5 #include "content/browser/gpu/gpu_process_host_ui_shim.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "base/id_map.h" 10 #include "base/id_map.h"
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 DCHECK(CalledOnValidThread()); 190 DCHECK(CalledOnValidThread());
191 191
192 IPC_BEGIN_MESSAGE_MAP(GpuProcessHostUIShim, message) 192 IPC_BEGIN_MESSAGE_MAP(GpuProcessHostUIShim, message)
193 IPC_MESSAGE_HANDLER(GpuHostMsg_OnLogMessage, 193 IPC_MESSAGE_HANDLER(GpuHostMsg_OnLogMessage,
194 OnLogMessage) 194 OnLogMessage)
195 195
196 IPC_MESSAGE_HANDLER(GpuHostMsg_AcceleratedSurfaceBuffersSwapped, 196 IPC_MESSAGE_HANDLER(GpuHostMsg_AcceleratedSurfaceBuffersSwapped,
197 OnAcceleratedSurfaceBuffersSwapped) 197 OnAcceleratedSurfaceBuffersSwapped)
198 IPC_MESSAGE_HANDLER(GpuHostMsg_AcceleratedSurfacePostSubBuffer, 198 IPC_MESSAGE_HANDLER(GpuHostMsg_AcceleratedSurfacePostSubBuffer,
199 OnAcceleratedSurfacePostSubBuffer) 199 OnAcceleratedSurfacePostSubBuffer)
200 IPC_MESSAGE_HANDLER(GpuHostMsg_GraphicsInfoCollected,
201 OnGraphicsInfoCollected)
200 202
201 #if defined(TOOLKIT_USES_GTK) || defined(OS_WIN) 203 #if defined(TOOLKIT_USES_GTK) || defined(OS_WIN)
202 IPC_MESSAGE_HANDLER(GpuHostMsg_ResizeView, OnResizeView) 204 IPC_MESSAGE_HANDLER(GpuHostMsg_ResizeView, OnResizeView)
203 #endif 205 #endif
204 206
205 #if defined(OS_MACOSX) || defined(UI_COMPOSITOR_IMAGE_TRANSPORT) 207 #if defined(OS_MACOSX) || defined(UI_COMPOSITOR_IMAGE_TRANSPORT)
206 IPC_MESSAGE_HANDLER(GpuHostMsg_AcceleratedSurfaceNew, 208 IPC_MESSAGE_HANDLER(GpuHostMsg_AcceleratedSurfaceNew,
207 OnAcceleratedSurfaceNew) 209 OnAcceleratedSurfaceNew)
208 #endif 210 #endif
209 211
(...skipping 12 matching lines...) Expand all
222 int level, 224 int level,
223 const std::string& header, 225 const std::string& header,
224 const std::string& message) { 226 const std::string& message) {
225 DictionaryValue* dict = new DictionaryValue(); 227 DictionaryValue* dict = new DictionaryValue();
226 dict->SetInteger("level", level); 228 dict->SetInteger("level", level);
227 dict->SetString("header", header); 229 dict->SetString("header", header);
228 dict->SetString("message", message); 230 dict->SetString("message", message);
229 GpuDataManager::GetInstance()->AddLogMessage(dict); 231 GpuDataManager::GetInstance()->AddLogMessage(dict);
230 } 232 }
231 233
234 void GpuProcessHostUIShim::OnGraphicsInfoCollected(
235 const content::GPUInfo& gpu_info) {
236 // OnGraphicsInfoCollected is sent back after the GPU process successfully
237 // initializes GL.
238 TRACE_EVENT0("test_gpu", "OnGraphicsInfoCollected");
239
240 GpuDataManager::GetInstance()->UpdateGpuInfo(gpu_info);
241 }
242
232 #if defined(TOOLKIT_USES_GTK) || defined(OS_WIN) 243 #if defined(TOOLKIT_USES_GTK) || defined(OS_WIN)
233 244
234 void GpuProcessHostUIShim::OnResizeView(int32 renderer_id, 245 void GpuProcessHostUIShim::OnResizeView(int32 renderer_id,
235 int32 render_view_id, 246 int32 render_view_id,
236 int32 route_id, 247 int32 route_id,
237 gfx::Size size) { 248 gfx::Size size) {
238 // Always respond even if the window no longer exists. The GPU process cannot 249 // Always respond even if the window no longer exists. The GPU process cannot
239 // make progress on the resizing command buffer until it receives the 250 // make progress on the resizing command buffer until it receives the
240 // response. 251 // response.
241 ScopedSendOnIOThread delayed_send( 252 ScopedSendOnIOThread delayed_send(
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 void GpuProcessHostUIShim::OnAcceleratedSurfaceRelease( 388 void GpuProcessHostUIShim::OnAcceleratedSurfaceRelease(
378 const GpuHostMsg_AcceleratedSurfaceRelease_Params& params) { 389 const GpuHostMsg_AcceleratedSurfaceRelease_Params& params) {
379 RenderWidgetHostView* view = GetRenderWidgetHostViewFromID( 390 RenderWidgetHostView* view = GetRenderWidgetHostViewFromID(
380 params.renderer_id, params.render_view_id); 391 params.renderer_id, params.render_view_id);
381 if (!view) 392 if (!view)
382 return; 393 return;
383 view->AcceleratedSurfaceRelease(params.identifier); 394 view->AcceleratedSurfaceRelease(params.identifier);
384 } 395 }
385 396
386 #endif 397 #endif
OLDNEW
« no previous file with comments | « content/browser/gpu/gpu_process_host_ui_shim.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698