| Index: services/ui/surfaces/direct_output_surface_ozone.cc
|
| diff --git a/services/ui/surfaces/direct_output_surface_ozone.cc b/services/ui/surfaces/direct_output_surface_ozone.cc
|
| index 2bdf4b7dfa8cd462231c99850cfbf1ac94ae8412..e696053618367b794545a490c74758461cc4838f 100644
|
| --- a/services/ui/surfaces/direct_output_surface_ozone.cc
|
| +++ b/services/ui/surfaces/direct_output_surface_ozone.cc
|
| @@ -61,14 +61,26 @@ DirectOutputSurfaceOzone::~DirectOutputSurfaceOzone() {
|
| // TODO(rjkroege): Support cleanup.
|
| }
|
|
|
| -bool DirectOutputSurfaceOzone::IsDisplayedAsOverlayPlane() const {
|
| - // TODO(rjkroege): implement remaining overlay functionality.
|
| +bool DirectOutputSurfaceOzone::BindToClient(cc::OutputSurfaceClient* client) {
|
| + if (!cc::OutputSurface::BindToClient(client))
|
| + return false;
|
| +
|
| + if (capabilities_.uses_default_gl_framebuffer) {
|
| + capabilities_.flipped_output_surface =
|
| + context_provider()->ContextCapabilities().flips_vertically;
|
| + }
|
| return true;
|
| }
|
|
|
| -unsigned DirectOutputSurfaceOzone::GetOverlayTextureId() const {
|
| +void DirectOutputSurfaceOzone::EnsureBackbuffer() {}
|
| +
|
| +void DirectOutputSurfaceOzone::DiscardBackbuffer() {
|
| + context_provider()->ContextGL()->DiscardBackbufferCHROMIUM();
|
| +}
|
| +
|
| +void DirectOutputSurfaceOzone::BindFramebuffer() {
|
| DCHECK(buffer_queue_);
|
| - return buffer_queue_->current_texture_id();
|
| + buffer_queue_->BindFramebuffer();
|
| }
|
|
|
| void DirectOutputSurfaceOzone::SwapBuffers(cc::CompositorFrame frame) {
|
| @@ -94,21 +106,53 @@ void DirectOutputSurfaceOzone::SwapBuffers(cc::CompositorFrame frame) {
|
| gl->GenUnverifiedSyncTokenCHROMIUM(fence_sync, sync_token.GetData());
|
| }
|
|
|
| -bool DirectOutputSurfaceOzone::BindToClient(cc::OutputSurfaceClient* client) {
|
| - if (!cc::OutputSurface::BindToClient(client))
|
| - return false;
|
| +uint32_t DirectOutputSurfaceOzone::GetFramebufferCopyTextureFormat() {
|
| + return buffer_queue_->internal_format();
|
| +}
|
|
|
| - if (capabilities_.uses_default_gl_framebuffer) {
|
| - capabilities_.flipped_output_surface =
|
| - context_provider()->ContextCapabilities().flips_vertically;
|
| - }
|
| +// We call this on every frame but changing the size once we've allocated
|
| +// backing NativePixmapOzone instances will cause a DCHECK because
|
| +// Chrome never Reshape(s) after the first one from (0,0). NB: this implies
|
| +// that screen size changes need to be plumbed differently. In particular, we
|
| +// must create the native window in the size that the hardware reports.
|
| +void DirectOutputSurfaceOzone::Reshape(const gfx::Size& size,
|
| + float scale_factor,
|
| + const gfx::ColorSpace& color_space,
|
| + bool alpha) {
|
| + OutputSurface::Reshape(size, scale_factor, color_space, alpha);
|
| + DCHECK(buffer_queue_);
|
| + buffer_queue_->Reshape(SurfaceSize(), scale_factor, color_space);
|
| +}
|
| +
|
| +cc::OverlayCandidateValidator*
|
| +DirectOutputSurfaceOzone::GetOverlayCandidateValidator() const {
|
| + return nullptr;
|
| +}
|
| +
|
| +bool DirectOutputSurfaceOzone::IsDisplayedAsOverlayPlane() const {
|
| + // TODO(rjkroege): implement remaining overlay functionality.
|
| return true;
|
| }
|
|
|
| +unsigned DirectOutputSurfaceOzone::GetOverlayTextureId() const {
|
| + DCHECK(buffer_queue_);
|
| + return buffer_queue_->current_texture_id();
|
| +}
|
| +
|
| +bool DirectOutputSurfaceOzone::SurfaceIsSuspendForRecycle() const {
|
| + return false;
|
| +}
|
| +
|
| +bool DirectOutputSurfaceOzone::HasExternalStencilTest() const {
|
| + return false;
|
| +}
|
| +
|
| +void DirectOutputSurfaceOzone::ApplyExternalStencil() {}
|
| +
|
| void DirectOutputSurfaceOzone::OnUpdateVSyncParametersFromGpu(
|
| base::TimeTicks timebase,
|
| base::TimeDelta interval) {
|
| - DCHECK(HasClient());
|
| + DCHECK(client_);
|
| synthetic_begin_frame_source_->OnUpdateVSyncParameters(timebase, interval);
|
| }
|
|
|
| @@ -125,33 +169,10 @@ void DirectOutputSurfaceOzone::OnGpuSwapBuffersCompleted(
|
| }
|
|
|
| buffer_queue_->PageFlipComplete();
|
| - OnSwapBuffersComplete();
|
| + client_->DidSwapBuffersComplete();
|
|
|
| if (force_swap)
|
| client_->SetNeedsRedrawRect(gfx::Rect(SurfaceSize()));
|
| }
|
|
|
| -void DirectOutputSurfaceOzone::BindFramebuffer() {
|
| - DCHECK(buffer_queue_);
|
| - buffer_queue_->BindFramebuffer();
|
| -}
|
| -
|
| -uint32_t DirectOutputSurfaceOzone::GetFramebufferCopyTextureFormat() {
|
| - return buffer_queue_->internal_format();
|
| -}
|
| -
|
| -// We call this on every frame but changing the size once we've allocated
|
| -// backing NativePixmapOzone instances will cause a DCHECK because
|
| -// Chrome never Reshape(s) after the first one from (0,0). NB: this implies
|
| -// that screen size changes need to be plumbed differently. In particular, we
|
| -// must create the native window in the size that the hardware reports.
|
| -void DirectOutputSurfaceOzone::Reshape(const gfx::Size& size,
|
| - float scale_factor,
|
| - const gfx::ColorSpace& color_space,
|
| - bool alpha) {
|
| - OutputSurface::Reshape(size, scale_factor, color_space, alpha);
|
| - DCHECK(buffer_queue_);
|
| - buffer_queue_->Reshape(SurfaceSize(), scale_factor, color_space);
|
| -}
|
| -
|
| } // namespace ui
|
|
|