| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "components/mus/surfaces/direct_output_surface_ozone.h" | 5 #include "components/mus/surfaces/direct_output_surface_ozone.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 | 138 |
| 139 if (force_swap) | 139 if (force_swap) |
| 140 client_->SetNeedsRedrawRect(gfx::Rect(SurfaceSize())); | 140 client_->SetNeedsRedrawRect(gfx::Rect(SurfaceSize())); |
| 141 } | 141 } |
| 142 | 142 |
| 143 void DirectOutputSurfaceOzone::BindFramebuffer() { | 143 void DirectOutputSurfaceOzone::BindFramebuffer() { |
| 144 DCHECK(buffer_queue_); | 144 DCHECK(buffer_queue_); |
| 145 buffer_queue_->BindFramebuffer(); | 145 buffer_queue_->BindFramebuffer(); |
| 146 } | 146 } |
| 147 | 147 |
| 148 uint32_t DirectOutputSurfaceOzone::GetFramebufferCopyTextureFormat() { |
| 149 return buffer_queue_->internal_format(); |
| 150 } |
| 151 |
| 148 // We call this on every frame but changing the size once we've allocated | 152 // We call this on every frame but changing the size once we've allocated |
| 149 // backing NativePixmapOzone instances will cause a DCHECK because | 153 // backing NativePixmapOzone instances will cause a DCHECK because |
| 150 // Chrome never Reshape(s) after the first one from (0,0). NB: this implies | 154 // Chrome never Reshape(s) after the first one from (0,0). NB: this implies |
| 151 // that screen size changes need to be plumbed differently. In particular, we | 155 // that screen size changes need to be plumbed differently. In particular, we |
| 152 // must create the native window in the size that the hardware reports. | 156 // must create the native window in the size that the hardware reports. |
| 153 void DirectOutputSurfaceOzone::Reshape(const gfx::Size& size, | 157 void DirectOutputSurfaceOzone::Reshape(const gfx::Size& size, |
| 154 float scale_factor, | 158 float scale_factor, |
| 155 bool alpha) { | 159 bool alpha) { |
| 156 OutputSurface::Reshape(size, scale_factor, alpha); | 160 OutputSurface::Reshape(size, scale_factor, alpha); |
| 157 DCHECK(buffer_queue_); | 161 DCHECK(buffer_queue_); |
| 158 buffer_queue_->Reshape(SurfaceSize(), scale_factor); | 162 buffer_queue_->Reshape(SurfaceSize(), scale_factor); |
| 159 } | 163 } |
| 160 | 164 |
| 161 } // namespace mus | 165 } // namespace mus |
| OLD | NEW |