Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(16)

Side by Side Diff: ui/ozone/platform/dri/gbm_surface.cc

Issue 847213002: [Ozone-DRI] Re-enable GBM surface mode support (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update tests Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/ozone/platform/dri/dri_wrapper.cc ('k') | ui/ozone/platform/dri/ozone_platform_gbm.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/bind.h" 9 #include "base/bind.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 } 125 }
126 126
127 bool GbmSurface::ResizeNativeWindow(const gfx::Size& viewport_size) { 127 bool GbmSurface::ResizeNativeWindow(const gfx::Size& viewport_size) {
128 if (size_ == viewport_size) 128 if (size_ == viewport_size)
129 return true; 129 return true;
130 130
131 return false; 131 return false;
132 } 132 }
133 133
134 bool GbmSurface::OnSwapBuffers() { 134 bool GbmSurface::OnSwapBuffers() {
135 NOTREACHED(); 135 return OnSwapBuffersAsync(base::Bind(&base::DoNothing));
136 return false;
137 } 136 }
138 137
139 bool GbmSurface::OnSwapBuffersAsync(const SwapCompletionCallback& callback) { 138 bool GbmSurface::OnSwapBuffersAsync(const SwapCompletionCallback& callback) {
140 DCHECK(native_surface_); 139 DCHECK(native_surface_);
141 140
142 gbm_bo* pending_buffer = gbm_surface_lock_front_buffer(native_surface_); 141 gbm_bo* pending_buffer = gbm_surface_lock_front_buffer(native_surface_);
143 scoped_refptr<GbmSurfaceBuffer> primary = 142 scoped_refptr<GbmSurfaceBuffer> primary =
144 GbmSurfaceBuffer::GetBuffer(pending_buffer); 143 GbmSurfaceBuffer::GetBuffer(pending_buffer);
145 if (!primary.get()) { 144 if (!primary.get()) {
146 primary = GbmSurfaceBuffer::CreateBuffer(dri_, pending_buffer); 145 primary = GbmSurfaceBuffer::CreateBuffer(dri_, pending_buffer);
(...skipping 22 matching lines...) Expand all
169 gbm_bo* pending_buffer) { 168 gbm_bo* pending_buffer) {
170 // If there was a frontbuffer, it is no longer active. Release it back to GBM. 169 // If there was a frontbuffer, it is no longer active. Release it back to GBM.
171 if (current_buffer_) 170 if (current_buffer_)
172 gbm_surface_release_buffer(native_surface_, current_buffer_); 171 gbm_surface_release_buffer(native_surface_, current_buffer_);
173 172
174 current_buffer_ = pending_buffer; 173 current_buffer_ = pending_buffer;
175 callback.Run(); 174 callback.Run();
176 } 175 }
177 176
178 } // namespace ui 177 } // namespace ui
OLDNEW
« no previous file with comments | « ui/ozone/platform/dri/dri_wrapper.cc ('k') | ui/ozone/platform/dri/ozone_platform_gbm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698