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 #if defined(OS_WIN) | 5 #if defined(OS_WIN) |
6 #include <windows.h> | 6 #include <windows.h> |
7 #endif | 7 #endif |
8 | 8 |
9 #include "content/browser/renderer_host/gpu_message_filter.h" | 9 #include "content/browser/renderer_host/gpu_message_filter.h" |
10 | 10 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 } | 47 } |
48 | 48 |
49 int route_id; | 49 int route_id; |
50 int surface_id; | 50 int surface_id; |
51 scoped_ptr<RenderWidgetHostViewFrameSubscriber> subscriber; | 51 scoped_ptr<RenderWidgetHostViewFrameSubscriber> subscriber; |
52 base::WeakPtrFactory<RenderWidgetHostViewFrameSubscriber> factory; | 52 base::WeakPtrFactory<RenderWidgetHostViewFrameSubscriber> factory; |
53 }; | 53 }; |
54 | 54 |
55 GpuMessageFilter::GpuMessageFilter(int render_process_id, | 55 GpuMessageFilter::GpuMessageFilter(int render_process_id, |
56 RenderWidgetHelper* render_widget_helper) | 56 RenderWidgetHelper* render_widget_helper) |
57 : BrowserMessageFilter(GpuMsgStart), | 57 : gpu_process_id_(0), |
58 gpu_process_id_(0), | |
59 render_process_id_(render_process_id), | 58 render_process_id_(render_process_id), |
60 share_contexts_(false), | 59 share_contexts_(false), |
61 render_widget_helper_(render_widget_helper), | 60 render_widget_helper_(render_widget_helper), |
62 weak_ptr_factory_(this) { | 61 weak_ptr_factory_(this) { |
63 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 62 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
64 | 63 |
65 #if defined(USE_AURA) || defined(OS_ANDROID) | 64 #if defined(USE_AURA) || defined(OS_ANDROID) |
66 // We use the GPU process for UI on Aura, and we need to share renderer GL | 65 // We use the GPU process for UI on Aura, and we need to share renderer GL |
67 // contexts with the compositor context. | 66 // contexts with the compositor context. |
68 share_contexts_ = true; | 67 share_contexts_ = true; |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 // so it is not necessary to end it. | 269 // so it is not necessary to end it. |
271 if (!host || !subscription->surface_id) | 270 if (!host || !subscription->surface_id) |
272 return; | 271 return; |
273 | 272 |
274 // Note that GpuProcessHost here might not be the same one that frame | 273 // Note that GpuProcessHost here might not be the same one that frame |
275 // subscription has applied. | 274 // subscription has applied. |
276 host->EndFrameSubscription(subscription->surface_id); | 275 host->EndFrameSubscription(subscription->surface_id); |
277 } | 276 } |
278 | 277 |
279 } // namespace content | 278 } // namespace content |
OLD | NEW |