OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/renderer/render_widget.h" | 5 #include "content/renderer/render_widget.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 2335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2346 // to avoid unnecessarily stalling the compositor thread. | 2346 // to avoid unnecessarily stalling the compositor thread. |
2347 limits.mapped_memory_reclaim_limit = | 2347 limits.mapped_memory_reclaim_limit = |
2348 max_transfer_buffer_usage_mb * kBytesPerMegabyte; | 2348 max_transfer_buffer_usage_mb * kBytesPerMegabyte; |
2349 #endif | 2349 #endif |
2350 if (compositor) { | 2350 if (compositor) { |
2351 limits.command_buffer_size = 64 * 1024; | 2351 limits.command_buffer_size = 64 * 1024; |
2352 limits.start_transfer_buffer_size = 64 * 1024; | 2352 limits.start_transfer_buffer_size = 64 * 1024; |
2353 limits.min_transfer_buffer_size = 64 * 1024; | 2353 limits.min_transfer_buffer_size = 64 * 1024; |
2354 } | 2354 } |
2355 | 2355 |
2356 // TODO(piman): we still need to create a View command buffer until | |
2357 // crbug.com/526196 is fixed. The surface_id doesn't matter, it just needs to | |
2358 // be !0. | |
2359 const int32 kDummySurfaceId = 1; | |
2360 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context( | 2356 scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context( |
2361 new WebGraphicsContext3DCommandBufferImpl( | 2357 new WebGraphicsContext3DCommandBufferImpl( |
2362 kDummySurfaceId, GetURLForGraphicsContext3D(), | 2358 0, GetURLForGraphicsContext3D(), gpu_channel_host.get(), attributes, |
2363 gpu_channel_host.get(), attributes, lose_context_when_out_of_memory, | 2359 lose_context_when_out_of_memory, limits, NULL)); |
2364 limits, NULL)); | |
2365 return context.Pass(); | 2360 return context.Pass(); |
2366 } | 2361 } |
2367 | 2362 |
2368 void RenderWidget::RegisterRenderFrameProxy(RenderFrameProxy* proxy) { | 2363 void RenderWidget::RegisterRenderFrameProxy(RenderFrameProxy* proxy) { |
2369 render_frame_proxies_.AddObserver(proxy); | 2364 render_frame_proxies_.AddObserver(proxy); |
2370 } | 2365 } |
2371 | 2366 |
2372 void RenderWidget::UnregisterRenderFrameProxy(RenderFrameProxy* proxy) { | 2367 void RenderWidget::UnregisterRenderFrameProxy(RenderFrameProxy* proxy) { |
2373 render_frame_proxies_.RemoveObserver(proxy); | 2368 render_frame_proxies_.RemoveObserver(proxy); |
2374 } | 2369 } |
(...skipping 10 matching lines...) Expand all Loading... |
2385 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) { | 2380 void RenderWidget::RegisterVideoHoleFrame(RenderFrameImpl* frame) { |
2386 video_hole_frames_.AddObserver(frame); | 2381 video_hole_frames_.AddObserver(frame); |
2387 } | 2382 } |
2388 | 2383 |
2389 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) { | 2384 void RenderWidget::UnregisterVideoHoleFrame(RenderFrameImpl* frame) { |
2390 video_hole_frames_.RemoveObserver(frame); | 2385 video_hole_frames_.RemoveObserver(frame); |
2391 } | 2386 } |
2392 #endif // defined(VIDEO_HOLE) | 2387 #endif // defined(VIDEO_HOLE) |
2393 | 2388 |
2394 } // namespace content | 2389 } // namespace content |
OLD | NEW |