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

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

Issue 552133004: Fix more uses of T* conversion operator from scoped_refptr<T> which is now removed (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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/demo/ozone_demo.cc ('k') | ui/ozone/platform/dri/gbm_surface_factory.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/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
128 128
129 return false; 129 return false;
130 } 130 }
131 131
132 bool GbmSurface::OnSwapBuffers() { 132 bool GbmSurface::OnSwapBuffers() {
133 DCHECK(native_surface_); 133 DCHECK(native_surface_);
134 134
135 gbm_bo* pending_buffer = gbm_surface_lock_front_buffer(native_surface_); 135 gbm_bo* pending_buffer = gbm_surface_lock_front_buffer(native_surface_);
136 scoped_refptr<GbmSurfaceBuffer> primary = 136 scoped_refptr<GbmSurfaceBuffer> primary =
137 GbmSurfaceBuffer::GetBuffer(pending_buffer); 137 GbmSurfaceBuffer::GetBuffer(pending_buffer);
138 if (!primary) { 138 if (!primary.get()) {
139 primary = GbmSurfaceBuffer::CreateBuffer(dri_, pending_buffer); 139 primary = GbmSurfaceBuffer::CreateBuffer(dri_, pending_buffer);
140 if (!primary) { 140 if (!primary.get()) {
141 LOG(ERROR) << "Failed to associate the buffer with the controller"; 141 LOG(ERROR) << "Failed to associate the buffer with the controller";
142 return false; 142 return false;
143 } 143 }
144 } 144 }
145 145
146 // The primary buffer is a special case. 146 // The primary buffer is a special case.
147 if (window_delegate_->GetController()) 147 if (window_delegate_->GetController())
148 window_delegate_->GetController()->QueueOverlayPlane(OverlayPlane(primary)); 148 window_delegate_->GetController()->QueueOverlayPlane(OverlayPlane(primary));
149 149
150 if (!GbmSurfaceless::OnSwapBuffers()) 150 if (!GbmSurfaceless::OnSwapBuffers())
151 return false; 151 return false;
152 152
153 // If there was a frontbuffer, it is no longer active. Release it back to GBM. 153 // If there was a frontbuffer, it is no longer active. Release it back to GBM.
154 if (current_buffer_) 154 if (current_buffer_)
155 gbm_surface_release_buffer(native_surface_, current_buffer_); 155 gbm_surface_release_buffer(native_surface_, current_buffer_);
156 156
157 current_buffer_ = pending_buffer; 157 current_buffer_ = pending_buffer;
158 return true; 158 return true;
159 } 159 }
160 160
161 } // namespace ui 161 } // namespace ui
OLDNEW
« no previous file with comments | « ui/ozone/demo/ozone_demo.cc ('k') | ui/ozone/platform/dri/gbm_surface_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698