diff options
author | Ben Murdoch <benm@google.com> | 2014-11-22 01:28:32 +0000 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2014-11-22 01:28:32 +0000 |
commit | e4256316f8b5e8d1ec0df1f7762771622a53fa63 (patch) | |
tree | 9d8282f7a323fad191129fddbcf5601903fa161c /content/common/gpu | |
parent | 165c68f9802332588874b0a207d7f49d03009ddf (diff) | |
download | chromium_org-e4256316f8b5e8d1ec0df1f7762771622a53fa63.tar.gz |
Merge from Chromium at DEPS revision 39.0.2171.90
This commit was generated by merge_to_master.py.
Change-Id: I1bb301dcfe74249d8b66fb60ba577e9095c86b8d
Diffstat (limited to 'content/common/gpu')
5 files changed, 41 insertions, 33 deletions
diff --git a/content/common/gpu/OWNERS b/content/common/gpu/OWNERS index c454171381..4bc8abc917 100644 --- a/content/common/gpu/OWNERS +++ b/content/common/gpu/OWNERS @@ -1,3 +1,4 @@ +ccameron@chromium.org jbauman@chromium.org kbr@chromium.org piman@chromium.org diff --git a/content/common/gpu/image_transport_surface_calayer_mac.mm b/content/common/gpu/image_transport_surface_calayer_mac.mm index 7531297ece..1b4166db76 100644 --- a/content/common/gpu/image_transport_surface_calayer_mac.mm +++ b/content/common/gpu/image_transport_surface_calayer_mac.mm @@ -128,9 +128,6 @@ bool CALayerStorageProvider::AllocateColorBufferStorage( } glFlush(); - // Disable the fade-in animation as the layer is changed. - ScopedCAActionDisabler disabler; - // Set the parameters that will be used to allocate the CALayer to draw the // texture into. share_group_context_.reset(CGLRetainContext(context)); diff --git a/content/common/gpu/image_transport_surface_fbo_mac.h b/content/common/gpu/image_transport_surface_fbo_mac.h index de501005a0..46209638b4 100644 --- a/content/common/gpu/image_transport_surface_fbo_mac.h +++ b/content/common/gpu/image_transport_surface_fbo_mac.h @@ -86,7 +86,7 @@ class ImageTransportSurfaceFBO // ImageTransportSurface implementation virtual void OnBufferPresented( const AcceleratedSurfaceMsg_BufferPresented_Params& params) OVERRIDE; - virtual void OnResize(gfx::Size size, float scale_factor) OVERRIDE; + virtual void OnResize(gfx::Size pixel_size, float scale_factor) OVERRIDE; virtual void SetLatencyInfo( const std::vector<ui::LatencyInfo>&) OVERRIDE; virtual void WakeUpGpu() OVERRIDE; @@ -99,7 +99,8 @@ class ImageTransportSurfaceFBO void AdjustBufferAllocation(); void DestroyFramebuffer(); - void CreateFramebuffer(); + void AllocateOrResizeFramebuffer( + const gfx::Size& pixel_size, float scale_factor); scoped_ptr<StorageProvider> storage_provider_; @@ -115,8 +116,8 @@ class ImageTransportSurfaceFBO // Weak pointer to the context that this was last made current to. gfx::GLContext* context_; - gfx::Size size_; - gfx::Size rounded_size_; + gfx::Size pixel_size_; + gfx::Size rounded_pixel_size_; float scale_factor_; // Whether or not we've successfully made the surface current once. diff --git a/content/common/gpu/image_transport_surface_fbo_mac.mm b/content/common/gpu/image_transport_surface_fbo_mac.mm index 343ee83bfc..2e02012a4a 100644 --- a/content/common/gpu/image_transport_surface_fbo_mac.mm +++ b/content/common/gpu/image_transport_surface_fbo_mac.mm @@ -77,7 +77,7 @@ bool ImageTransportSurfaceFBO::OnMakeCurrent(gfx::GLContext* context) { if (made_current_) return true; - OnResize(gfx::Size(1, 1), 1.f); + AllocateOrResizeFramebuffer(gfx::Size(1, 1), 1.f); made_current_ = true; return true; @@ -113,7 +113,7 @@ void ImageTransportSurfaceFBO::AdjustBufferAllocation() { DestroyFramebuffer(); helper_->Suspend(); } else if (backbuffer_suggested_allocation_ && !has_complete_framebuffer_) { - CreateFramebuffer(); + AllocateOrResizeFramebuffer(pixel_size_, scale_factor_); } } @@ -125,7 +125,7 @@ bool ImageTransportSurfaceFBO::SwapBuffers() { // It is the responsibility of the storage provider to send the swap IPC. is_swap_buffers_send_pending_ = true; - storage_provider_->SwapBuffers(size_, scale_factor_); + storage_provider_->SwapBuffers(pixel_size_, scale_factor_); return true; } @@ -153,7 +153,7 @@ bool ImageTransportSurfaceFBO::SupportsPostSubBuffer() { } gfx::Size ImageTransportSurfaceFBO::GetSize() { - return size_; + return pixel_size_; } void* ImageTransportSurfaceFBO::GetHandle() { @@ -170,17 +170,15 @@ void ImageTransportSurfaceFBO::OnBufferPresented( storage_provider_->SwapBuffersAckedByBrowser(); } -void ImageTransportSurfaceFBO::OnResize(gfx::Size size, +void ImageTransportSurfaceFBO::OnResize(gfx::Size pixel_size, float scale_factor) { TRACE_EVENT2("gpu", "ImageTransportSurfaceFBO::OnResize", - "old_width", size_.width(), "new_width", size.width()); + "old_size", pixel_size_.ToString(), + "new_size", pixel_size.ToString()); // Caching |context_| from OnMakeCurrent. It should still be current. DCHECK(context_->IsCurrent(this)); - size_ = size; - scale_factor_ = scale_factor; - - CreateFramebuffer(); + AllocateOrResizeFramebuffer(pixel_size, scale_factor); } void ImageTransportSurfaceFBO::SetLatencyInfo( @@ -227,18 +225,29 @@ void ImageTransportSurfaceFBO::DestroyFramebuffer() { has_complete_framebuffer_ = false; } -void ImageTransportSurfaceFBO::CreateFramebuffer() { - gfx::Size new_rounded_size = storage_provider_->GetRoundedSize(size_); +void ImageTransportSurfaceFBO::AllocateOrResizeFramebuffer( + const gfx::Size& new_pixel_size, float new_scale_factor) { + gfx::Size new_rounded_pixel_size = + storage_provider_->GetRoundedSize(new_pixel_size); - // Only recreate surface when the rounded up size has changed. - if (has_complete_framebuffer_ && new_rounded_size == rounded_size_) - return; + // Only recreate the surface's storage when the rounded up size has changed, + // or the scale factor has changed. + bool needs_new_storage = + !has_complete_framebuffer_ || + new_rounded_pixel_size != rounded_pixel_size_ || + new_scale_factor != scale_factor_; - TRACE_EVENT2("gpu", "ImageTransportSurfaceFBO::CreateFramebuffer", - "width", new_rounded_size.width(), - "height", new_rounded_size.height()); + // Save the new storage parameters. + pixel_size_ = new_pixel_size; + rounded_pixel_size_ = new_rounded_pixel_size; + scale_factor_ = new_scale_factor; + + if (!needs_new_storage) + return; - rounded_size_ = new_rounded_size; + TRACE_EVENT2("gpu", "ImageTransportSurfaceFBO::AllocateOrResizeFramebuffer", + "width", new_rounded_pixel_size.width(), + "height", new_rounded_pixel_size.height()); // GL_TEXTURE_RECTANGLE_ARB is the best supported render target on // Mac OS X and is required for IOSurface interoperability. @@ -284,7 +293,8 @@ void ImageTransportSurfaceFBO::CreateFramebuffer() { glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, depth_stencil_renderbuffer_id_); glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH24_STENCIL8_EXT, - rounded_size_.width(), rounded_size_.height()); + rounded_pixel_size_.width(), + rounded_pixel_size_.height()); glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_STENCIL_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, @@ -299,7 +309,7 @@ void ImageTransportSurfaceFBO::CreateFramebuffer() { bool allocated_color_buffer = storage_provider_->AllocateColorBufferStorage( static_cast<CGLContextObj>(context_->GetHandle()), texture_id_, - rounded_size_, scale_factor_); + rounded_pixel_size_, scale_factor_); if (!allocated_color_buffer) { DLOG(ERROR) << "Failed to allocate color buffer storage."; DestroyFramebuffer(); diff --git a/content/common/gpu/media/dxva_video_decode_accelerator.cc b/content/common/gpu/media/dxva_video_decode_accelerator.cc index d0e98b7457..530358e155 100644 --- a/content/common/gpu/media/dxva_video_decode_accelerator.cc +++ b/content/common/gpu/media/dxva_video_decode_accelerator.cc @@ -323,7 +323,7 @@ bool DXVAVideoDecodeAccelerator::DXVAPictureBuffer:: glBindTexture(GL_TEXTURE_2D, picture_buffer_.texture_id()); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); base::win::ScopedComPtr<IDirect3DSurface9> d3d_surface; hr = decoding_texture_->GetSurfaceLevel(0, d3d_surface.Receive()); @@ -362,7 +362,7 @@ bool DXVAVideoDecodeAccelerator::DXVAPictureBuffer:: egl_display, decoding_surface_, EGL_BACK_BUFFER); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glBindTexture(GL_TEXTURE_2D, current_texture); return true; } @@ -456,10 +456,9 @@ bool DXVAVideoDecodeAccelerator::Initialize(media::VideoCodecProfile profile, // TODO(ananta) // H264PROFILE_HIGH video decoding is janky at times. Needs more - // investigation. + // investigation. http://crbug.com/426707 if (profile != media::H264PROFILE_BASELINE && - profile != media::H264PROFILE_MAIN && - profile != media::H264PROFILE_HIGH) { + profile != media::H264PROFILE_MAIN) { RETURN_AND_NOTIFY_ON_FAILURE(false, "Unsupported h264 profile", PLATFORM_FAILURE, false); } |