diff options
Diffstat (limited to 'content/browser')
6 files changed, 32 insertions, 26 deletions
diff --git a/content/browser/compositor/owned_mailbox.cc b/content/browser/compositor/owned_mailbox.cc index 06a60e4..9c7b378 100644 --- a/content/browser/compositor/owned_mailbox.cc +++ b/content/browser/compositor/owned_mailbox.cc @@ -11,9 +11,9 @@ namespace content { OwnedMailbox::OwnedMailbox(GLHelper* gl_helper) - : texture_id_(0), sync_point_(0), gl_helper_(gl_helper) { + : texture_id_(0), gl_helper_(gl_helper) { texture_id_ = gl_helper_->CreateTexture(); - mailbox_ = gl_helper_->ProduceMailboxFromTexture(texture_id_, &sync_point_); + mailbox_holder_ = gl_helper_->ProduceMailboxHolderFromTexture(texture_id_); ImageTransportFactory::GetInstance()->AddObserver(this); } @@ -24,16 +24,15 @@ OwnedMailbox::~OwnedMailbox() { void OwnedMailbox::UpdateSyncPoint(uint32 sync_point) { if (sync_point) - sync_point_ = sync_point; + mailbox_holder_.sync_point = sync_point; } void OwnedMailbox::Destroy() { ImageTransportFactory::GetInstance()->RemoveObserver(this); - gl_helper_->WaitSyncPoint(sync_point_); + gl_helper_->WaitSyncPoint(mailbox_holder_.sync_point); gl_helper_->DeleteTexture(texture_id_); texture_id_ = 0; - mailbox_ = gpu::Mailbox(); - sync_point_ = 0; + mailbox_holder_ = gpu::MailboxHolder(); gl_helper_ = NULL; } diff --git a/content/browser/compositor/owned_mailbox.h b/content/browser/compositor/owned_mailbox.h index a574ae4..e3adcbd 100644 --- a/content/browser/compositor/owned_mailbox.h +++ b/content/browser/compositor/owned_mailbox.h @@ -4,7 +4,7 @@ #include "base/memory/ref_counted.h" #include "content/browser/compositor/image_transport_factory.h" -#include "gpu/command_buffer/common/mailbox.h" +#include "gpu/command_buffer/common/mailbox_holder.h" namespace content { @@ -18,10 +18,10 @@ class OwnedMailbox : public base::RefCounted<OwnedMailbox>, public: explicit OwnedMailbox(GLHelper* gl_helper); + const gpu::Mailbox& mailbox() const { return mailbox_holder_.mailbox; } uint32 texture_id() const { return texture_id_; } - uint32 sync_point() const { return sync_point_; } - const gpu::Mailbox& mailbox() const { return mailbox_; } - + uint32 target() const { return mailbox_holder_.texture_target; } + uint32 sync_point() const { return mailbox_holder_.sync_point; } void UpdateSyncPoint(uint32 sync_point); void Destroy(); @@ -35,8 +35,7 @@ class OwnedMailbox : public base::RefCounted<OwnedMailbox>, friend class base::RefCounted<OwnedMailbox>; uint32 texture_id_; - gpu::Mailbox mailbox_; - uint32 sync_point_; + gpu::MailboxHolder mailbox_holder_; GLHelper* gl_helper_; }; diff --git a/content/browser/renderer_host/media/desktop_capture_device_aura.cc b/content/browser/renderer_host/media/desktop_capture_device_aura.cc index 03e9c89..f16d564 100644 --- a/content/browser/renderer_host/media/desktop_capture_device_aura.cc +++ b/content/browser/renderer_host/media/desktop_capture_device_aura.cc @@ -343,9 +343,15 @@ void DesktopVideoCaptureMachine::DidCopyOutput( gfx::Point cursor_position_in_frame = UpdateCursorState(region_in_frame); yuv_readback_pipeline_->ReadbackYUV( - texture_mailbox.name(), texture_mailbox.sync_point(), video_frame.get(), - base::Bind(&CopyOutputFinishedForVideo, start_time, capture_frame_cb, - video_frame, scaled_cursor_bitmap_, cursor_position_in_frame, + texture_mailbox.mailbox(), + texture_mailbox.sync_point(), + video_frame.get(), + base::Bind(&CopyOutputFinishedForVideo, + start_time, + capture_frame_cb, + video_frame, + scaled_cursor_bitmap_, + cursor_position_in_frame, base::Passed(&release_callback))); } diff --git a/content/browser/renderer_host/render_widget_host_view_android.cc b/content/browser/renderer_host/render_widget_host_view_android.cc index e90ab1c..2b78167 100644 --- a/content/browser/renderer_host/render_widget_host_view_android.cc +++ b/content/browser/renderer_host/render_widget_host_view_android.cc @@ -1406,7 +1406,7 @@ void RenderWidgetHostViewAndroid::PrepareTextureCopyOutputResult( ignore_result(scoped_callback_runner.Release()); gl_helper->CropScaleReadbackAndCleanMailbox( - texture_mailbox.name(), + texture_mailbox.mailbox(), texture_mailbox.sync_point(), result->size(), gfx::Rect(result->size()), diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc index f0fe263..27f54ec 100644 --- a/content/browser/renderer_host/render_widget_host_view_aura.cc +++ b/content/browser/renderer_host/render_widget_host_view_aura.cc @@ -100,7 +100,8 @@ namespace content { namespace { void MailboxReleaseCallback(scoped_ptr<base::SharedMemory> shared_memory, - unsigned sync_point, bool lost_resource) { + uint32 sync_point, + bool lost_resource) { // NOTE: shared_memory will get released when we go out of scope. } @@ -1110,8 +1111,10 @@ void RenderWidgetHostViewAura::CopyFromCompositingSurfaceToVideoFrame( ConvertRectToPixel(current_device_scale_factor_, src_subrect); request->set_area(src_subrect_in_pixel); if (subscriber_texture.get()) { - request->SetTextureMailbox(cc::TextureMailbox( - subscriber_texture->mailbox(), subscriber_texture->sync_point())); + request->SetTextureMailbox( + cc::TextureMailbox(subscriber_texture->mailbox(), + subscriber_texture->target(), + subscriber_texture->sync_point())); } RequestCopyOfOutput(request.Pass()); } @@ -1865,7 +1868,7 @@ void RenderWidgetHostViewAura::PrepareTextureCopyOutputResult( ignore_result(scoped_callback_runner.Release()); gl_helper->CropScaleReadbackAndCleanMailbox( - texture_mailbox.name(), + texture_mailbox.mailbox(), texture_mailbox.sync_point(), result->size(), gfx::Rect(result->size()), @@ -2065,11 +2068,10 @@ void RenderWidgetHostViewAura::CopyFromCompositingSurfaceHasResultForVideo( callback, subscriber_texture, base::Passed(&release_callback)); - yuv_readback_pipeline->ReadbackYUV( - texture_mailbox.name(), - texture_mailbox.sync_point(), - video_frame.get(), - finished_callback); + yuv_readback_pipeline->ReadbackYUV(texture_mailbox.mailbox(), + texture_mailbox.sync_point(), + video_frame.get(), + finished_callback); } void RenderWidgetHostViewAura::GetScreenInfo(WebScreenInfo* results) { diff --git a/content/browser/renderer_host/software_frame_manager.cc b/content/browser/renderer_host/software_frame_manager.cc index cff9434..cb4efb6 100644 --- a/content/browser/renderer_host/software_frame_manager.cc +++ b/content/browser/renderer_host/software_frame_manager.cc @@ -13,7 +13,7 @@ namespace { void ReleaseMailbox(scoped_refptr<content::SoftwareFrame> frame, - unsigned sync_point, + uint32 sync_point, bool lost_resource) {} } // namespace |