| 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 "services/ui/surfaces/display_output_surface.h" | 5 #include "services/ui/surfaces/display_output_surface.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 context_provider()->ContextGL()->DiscardBackbufferCHROMIUM(); | 48 context_provider()->ContextGL()->DiscardBackbufferCHROMIUM(); |
| 49 } | 49 } |
| 50 | 50 |
| 51 void DisplayOutputSurface::BindFramebuffer() { | 51 void DisplayOutputSurface::BindFramebuffer() { |
| 52 context_provider()->ContextGL()->BindFramebuffer(GL_FRAMEBUFFER, 0); | 52 context_provider()->ContextGL()->BindFramebuffer(GL_FRAMEBUFFER, 0); |
| 53 } | 53 } |
| 54 | 54 |
| 55 void DisplayOutputSurface::Reshape(const gfx::Size& size, | 55 void DisplayOutputSurface::Reshape(const gfx::Size& size, |
| 56 float device_scale_factor, | 56 float device_scale_factor, |
| 57 const gfx::ColorSpace& color_space, | 57 const gfx::ColorSpace& color_space, |
| 58 bool has_alpha) { | 58 bool has_alpha, |
| 59 bool use_stencil) { |
| 59 context_provider()->ContextGL()->ResizeCHROMIUM( | 60 context_provider()->ContextGL()->ResizeCHROMIUM( |
| 60 size.width(), size.height(), device_scale_factor, has_alpha); | 61 size.width(), size.height(), device_scale_factor, has_alpha); |
| 61 } | 62 } |
| 62 | 63 |
| 63 void DisplayOutputSurface::SwapBuffers(cc::OutputSurfaceFrame frame) { | 64 void DisplayOutputSurface::SwapBuffers(cc::OutputSurfaceFrame frame) { |
| 64 DCHECK(context_provider_); | 65 DCHECK(context_provider_); |
| 65 if (frame.sub_buffer_rect == gfx::Rect(frame.size)) { | 66 if (frame.sub_buffer_rect == gfx::Rect(frame.size)) { |
| 66 context_provider_->ContextSupport()->Swap(); | 67 context_provider_->ContextSupport()->Swap(); |
| 67 } else { | 68 } else { |
| 68 context_provider_->ContextSupport()->PartialSwapBuffers( | 69 context_provider_->ContextSupport()->PartialSwapBuffers( |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 | 110 |
| 110 void DisplayOutputSurface::OnVSyncParametersUpdated(base::TimeTicks timebase, | 111 void DisplayOutputSurface::OnVSyncParametersUpdated(base::TimeTicks timebase, |
| 111 base::TimeDelta interval) { | 112 base::TimeDelta interval) { |
| 112 // TODO(brianderson): We should not be receiving 0 intervals. | 113 // TODO(brianderson): We should not be receiving 0 intervals. |
| 113 synthetic_begin_frame_source_->OnUpdateVSyncParameters( | 114 synthetic_begin_frame_source_->OnUpdateVSyncParameters( |
| 114 timebase, | 115 timebase, |
| 115 interval.is_zero() ? cc::BeginFrameArgs::DefaultInterval() : interval); | 116 interval.is_zero() ? cc::BeginFrameArgs::DefaultInterval() : interval); |
| 116 } | 117 } |
| 117 | 118 |
| 118 } // namespace ui | 119 } // namespace ui |
| OLD | NEW |