OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "base/bind_helpers.h" | 5 #include "base/bind_helpers.h" |
6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "content/browser/browser_plugin/browser_plugin_guest.h" | 9 #include "content/browser/browser_plugin/browser_plugin_guest.h" |
10 #include "content/browser/frame_host/render_widget_host_view_guest.h" | 10 #include "content/browser/frame_host/render_widget_host_view_guest.h" |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 const base::string16& tooltip_text) { | 160 const base::string16& tooltip_text) { |
161 platform_view_->SetTooltipText(tooltip_text); | 161 platform_view_->SetTooltipText(tooltip_text); |
162 } | 162 } |
163 | 163 |
164 void RenderWidgetHostViewGuest::AcceleratedSurfaceBuffersSwapped( | 164 void RenderWidgetHostViewGuest::AcceleratedSurfaceBuffersSwapped( |
165 const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params, | 165 const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params, |
166 int gpu_host_id) { | 166 int gpu_host_id) { |
167 if (!guest_) | 167 if (!guest_) |
168 return; | 168 return; |
169 | 169 |
170 // If accelerated surface buffers are getting swapped then we're not using | |
171 // the software path. | |
172 guest_->clear_damage_buffer(); | |
173 FrameMsg_BuffersSwapped_Params guest_params; | 170 FrameMsg_BuffersSwapped_Params guest_params; |
174 guest_params.size = params.size; | 171 guest_params.size = params.size; |
175 guest_params.mailbox = params.mailbox; | 172 guest_params.mailbox = params.mailbox; |
176 guest_params.gpu_route_id = params.route_id; | 173 guest_params.gpu_route_id = params.route_id; |
177 guest_params.gpu_host_id = gpu_host_id; | 174 guest_params.gpu_host_id = gpu_host_id; |
178 guest_->SendMessageToEmbedder( | 175 guest_->SendMessageToEmbedder( |
179 new BrowserPluginMsg_BuffersSwapped(guest_->instance_id(), | 176 new BrowserPluginMsg_BuffersSwapped(guest_->instance_id(), |
180 guest_params)); | 177 guest_params)); |
181 } | 178 } |
182 | 179 |
183 void RenderWidgetHostViewGuest::AcceleratedSurfacePostSubBuffer( | 180 void RenderWidgetHostViewGuest::AcceleratedSurfacePostSubBuffer( |
184 const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params, | 181 const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params, |
185 int gpu_host_id) { | 182 int gpu_host_id) { |
186 NOTREACHED(); | 183 NOTREACHED(); |
187 } | 184 } |
188 | 185 |
189 void RenderWidgetHostViewGuest::OnSwapCompositorFrame( | 186 void RenderWidgetHostViewGuest::OnSwapCompositorFrame( |
190 uint32 output_surface_id, | 187 uint32 output_surface_id, |
191 scoped_ptr<cc::CompositorFrame> frame) { | 188 scoped_ptr<cc::CompositorFrame> frame) { |
192 if (!guest_) | 189 if (!guest_) |
193 return; | 190 return; |
194 | 191 |
195 guest_->clear_damage_buffer(); | |
196 | |
197 if (!guest_->attached()) { | 192 if (!guest_->attached()) { |
198 // If the guest doesn't have an embedder then there's nothing to give the | 193 // If the guest doesn't have an embedder then there's nothing to give the |
199 // the frame to. | 194 // the frame to. |
200 return; | 195 return; |
201 } | 196 } |
202 base::SharedMemoryHandle software_frame_handle = | 197 base::SharedMemoryHandle software_frame_handle = |
203 base::SharedMemory::NULLHandle(); | 198 base::SharedMemory::NULLHandle(); |
204 if (frame->software_frame_data) { | 199 if (frame->software_frame_data) { |
205 cc::SoftwareFrameData* frame_data = frame->software_frame_data.get(); | 200 cc::SoftwareFrameData* frame_data = frame->software_frame_data.get(); |
206 scoped_ptr<cc::SharedBitmap> bitmap = | 201 scoped_ptr<cc::SharedBitmap> bitmap = |
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
585 ++g_it) { | 580 ++g_it) { |
586 ForwardGestureEventToRenderer(*g_it); | 581 ForwardGestureEventToRenderer(*g_it); |
587 } | 582 } |
588 } | 583 } |
589 | 584 |
590 SkBitmap::Config RenderWidgetHostViewGuest::PreferredReadbackFormat() { | 585 SkBitmap::Config RenderWidgetHostViewGuest::PreferredReadbackFormat() { |
591 return SkBitmap::kARGB_8888_Config; | 586 return SkBitmap::kARGB_8888_Config; |
592 } | 587 } |
593 | 588 |
594 } // namespace content | 589 } // namespace content |
OLD | NEW |