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 "ui/ozone/platform/dri/gbm_surface.h" | 5 #include "ui/ozone/platform/dri/gbm_surface.h" |
6 | 6 |
7 #include <gbm.h> | 7 #include <gbm.h> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "ui/ozone/platform/dri/dri_buffer.h" | 10 #include "ui/ozone/platform/dri/dri_buffer.h" |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 GbmSurfaceBuffer::GetBuffer(pending_buffer); | 128 GbmSurfaceBuffer::GetBuffer(pending_buffer); |
129 if (!primary) { | 129 if (!primary) { |
130 primary = GbmSurfaceBuffer::CreateBuffer(dri_, pending_buffer); | 130 primary = GbmSurfaceBuffer::CreateBuffer(dri_, pending_buffer); |
131 if (!primary) { | 131 if (!primary) { |
132 LOG(ERROR) << "Failed to associate the buffer with the controller"; | 132 LOG(ERROR) << "Failed to associate the buffer with the controller"; |
133 return false; | 133 return false; |
134 } | 134 } |
135 } | 135 } |
136 | 136 |
137 // The primary buffer is a special case. | 137 // The primary buffer is a special case. |
138 queued_planes_.push_back(OverlayPlane(primary)); | 138 controller_->QueueOverlayPlane(OverlayPlane(primary)); |
139 | 139 |
140 if (!GbmSurfaceless::OnSwapBuffers()) | 140 if (!GbmSurfaceless::OnSwapBuffers()) |
141 return false; | 141 return false; |
142 | 142 |
143 // If there was a frontbuffer, it is no longer active. Release it back to GBM. | 143 // If there was a frontbuffer, it is no longer active. Release it back to GBM. |
144 if (current_buffer_) | 144 if (current_buffer_) |
145 gbm_surface_release_buffer(native_surface_, current_buffer_); | 145 gbm_surface_release_buffer(native_surface_, current_buffer_); |
146 | 146 |
147 current_buffer_ = pending_buffer; | 147 current_buffer_ = pending_buffer; |
148 return true; | 148 return true; |
149 } | 149 } |
150 | 150 |
151 } // namespace ui | 151 } // namespace ui |
OLD | NEW |