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/browser/renderer_host/render_widget_host_view_aura.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 return gesture.details().touch_points() == 1; | 273 return gesture.details().touch_points() == 1; |
274 } | 274 } |
275 | 275 |
276 return false; | 276 return false; |
277 } | 277 } |
278 | 278 |
279 // Swap ack for the renderer when kCompositeToMailbox is enabled. | 279 // Swap ack for the renderer when kCompositeToMailbox is enabled. |
280 void SendCompositorFrameAck( | 280 void SendCompositorFrameAck( |
281 int32 route_id, | 281 int32 route_id, |
282 int renderer_host_id, | 282 int renderer_host_id, |
283 const cc::Mailbox& received_mailbox, | 283 const gpu::Mailbox& received_mailbox, |
284 const gfx::Size& received_size, | 284 const gfx::Size& received_size, |
285 bool skip_frame, | 285 bool skip_frame, |
286 const scoped_refptr<ui::Texture>& texture_to_produce) { | 286 const scoped_refptr<ui::Texture>& texture_to_produce) { |
287 cc::CompositorFrameAck ack; | 287 cc::CompositorFrameAck ack; |
288 ack.gl_frame_data.reset(new cc::GLFrameData()); | 288 ack.gl_frame_data.reset(new cc::GLFrameData()); |
289 DCHECK(!texture_to_produce || !skip_frame); | 289 DCHECK(!texture_to_produce || !skip_frame); |
290 if (texture_to_produce) { | 290 if (texture_to_produce) { |
291 std::string mailbox_name = texture_to_produce->Produce(); | 291 std::string mailbox_name = texture_to_produce->Produce(); |
292 std::copy(mailbox_name.data(), | 292 std::copy(mailbox_name.data(), |
293 mailbox_name.data() + mailbox_name.length(), | 293 mailbox_name.data() + mailbox_name.length(), |
(...skipping 951 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1245 &AcknowledgeBufferForGpu, | 1245 &AcknowledgeBufferForGpu, |
1246 params_in_pixel.route_id, | 1246 params_in_pixel.route_id, |
1247 gpu_host_id, | 1247 gpu_host_id, |
1248 params_in_pixel.mailbox_name); | 1248 params_in_pixel.mailbox_name); |
1249 BuffersSwapped( | 1249 BuffersSwapped( |
1250 params_in_pixel.size, params_in_pixel.mailbox_name, ack_callback); | 1250 params_in_pixel.size, params_in_pixel.mailbox_name, ack_callback); |
1251 } | 1251 } |
1252 | 1252 |
1253 void RenderWidgetHostViewAura::OnSwapCompositorFrame( | 1253 void RenderWidgetHostViewAura::OnSwapCompositorFrame( |
1254 const cc::CompositorFrame& frame) { | 1254 const cc::CompositorFrame& frame) { |
1255 if (!frame.gl_frame_data || frame.gl_frame_data->mailbox.isZero()) | 1255 if (!frame.gl_frame_data || frame.gl_frame_data->mailbox.IsZero()) |
1256 return; | 1256 return; |
1257 | 1257 |
1258 BufferPresentedCallback ack_callback = base::Bind( | 1258 BufferPresentedCallback ack_callback = base::Bind( |
1259 &SendCompositorFrameAck, | 1259 &SendCompositorFrameAck, |
1260 host_->GetRoutingID(), host_->GetProcess()->GetID(), | 1260 host_->GetRoutingID(), host_->GetProcess()->GetID(), |
1261 frame.gl_frame_data->mailbox, frame.gl_frame_data->size); | 1261 frame.gl_frame_data->mailbox, frame.gl_frame_data->size); |
1262 | 1262 |
1263 if (!frame.gl_frame_data->sync_point) { | 1263 if (!frame.gl_frame_data->sync_point) { |
1264 LOG(ERROR) << "CompositorFrame without sync point. Skipping frame..."; | 1264 LOG(ERROR) << "CompositorFrame without sync point. Skipping frame..."; |
1265 ack_callback.Run(true, scoped_refptr<ui::Texture>()); | 1265 ack_callback.Run(true, scoped_refptr<ui::Texture>()); |
(...skipping 1171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2437 RenderWidgetHost* widget) { | 2437 RenderWidgetHost* widget) { |
2438 return new RenderWidgetHostViewAura(widget); | 2438 return new RenderWidgetHostViewAura(widget); |
2439 } | 2439 } |
2440 | 2440 |
2441 // static | 2441 // static |
2442 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { | 2442 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { |
2443 GetScreenInfoForWindow(results, NULL); | 2443 GetScreenInfoForWindow(results, NULL); |
2444 } | 2444 } |
2445 | 2445 |
2446 } // namespace content | 2446 } // namespace content |
OLD | NEW |