Commit 91af9a88 authored by tiago.vignatti's avatar tiago.vignatti Committed by Commit bot

Fix more uses of T* conversion operator from scoped_refptr<T> which is now removed

Fix more uses of T* conversion operator from scoped_refptr<T> which is now removed.

Please see https://codereview.chromium.org/510323002 for reference.

TEST=ozone_demo and content_shell under Ozone-GBM
BUG=none
NOTRY=true

Review URL: https://codereview.chromium.org/552133004

Cr-Commit-Position: refs/heads/master@{#294172}
parent 2c53e25a
...@@ -86,14 +86,14 @@ class DemoWindow : public ui::PlatformWindowDelegate { ...@@ -86,14 +86,14 @@ class DemoWindow : public ui::PlatformWindowDelegate {
private: private:
bool InitializeGLSurface() { bool InitializeGLSurface() {
surface_ = gfx::GLSurface::CreateViewGLSurface(GetAcceleratedWidget()); surface_ = gfx::GLSurface::CreateViewGLSurface(GetAcceleratedWidget());
if (!surface_) { if (!surface_.get()) {
LOG(ERROR) << "Failed to create GL surface"; LOG(ERROR) << "Failed to create GL surface";
return false; return false;
} }
context_ = gfx::GLContext::CreateGLContext( context_ = gfx::GLContext::CreateGLContext(
NULL, surface_.get(), gfx::PreferIntegratedGpu); NULL, surface_.get(), gfx::PreferIntegratedGpu);
if (!context_) { if (!context_.get()) {
LOG(ERROR) << "Failed to create GL context"; LOG(ERROR) << "Failed to create GL context";
surface_ = NULL; surface_ = NULL;
return false; return false;
......
...@@ -135,9 +135,9 @@ bool GbmSurface::OnSwapBuffers() { ...@@ -135,9 +135,9 @@ bool GbmSurface::OnSwapBuffers() {
gbm_bo* pending_buffer = gbm_surface_lock_front_buffer(native_surface_); gbm_bo* pending_buffer = gbm_surface_lock_front_buffer(native_surface_);
scoped_refptr<GbmSurfaceBuffer> primary = scoped_refptr<GbmSurfaceBuffer> primary =
GbmSurfaceBuffer::GetBuffer(pending_buffer); GbmSurfaceBuffer::GetBuffer(pending_buffer);
if (!primary) { if (!primary.get()) {
primary = GbmSurfaceBuffer::CreateBuffer(dri_, pending_buffer); primary = GbmSurfaceBuffer::CreateBuffer(dri_, pending_buffer);
if (!primary) { if (!primary.get()) {
LOG(ERROR) << "Failed to associate the buffer with the controller"; LOG(ERROR) << "Failed to associate the buffer with the controller";
return false; return false;
} }
......
...@@ -174,7 +174,7 @@ scoped_refptr<ui::NativePixmap> GbmSurfaceFactory::CreateNativePixmap( ...@@ -174,7 +174,7 @@ scoped_refptr<ui::NativePixmap> GbmSurfaceFactory::CreateNativePixmap(
BufferFormat format) { BufferFormat format) {
scoped_refptr<GbmBuffer> buffer = GbmBuffer::CreateBuffer( scoped_refptr<GbmBuffer> buffer = GbmBuffer::CreateBuffer(
drm_, device_, format, size, true); drm_, device_, format, size, true);
if (!buffer) if (!buffer.get())
return NULL; return NULL;
return scoped_refptr<GbmPixmap>(new GbmPixmap(buffer)); return scoped_refptr<GbmPixmap>(new GbmPixmap(buffer));
...@@ -196,7 +196,7 @@ bool GbmSurfaceFactory::ScheduleOverlayPlane( ...@@ -196,7 +196,7 @@ bool GbmSurfaceFactory::ScheduleOverlayPlane(
const gfx::Rect& display_bounds, const gfx::Rect& display_bounds,
const gfx::RectF& crop_rect) { const gfx::RectF& crop_rect) {
scoped_refptr<GbmPixmap> pixmap = static_cast<GbmPixmap*>(buffer.get()); scoped_refptr<GbmPixmap> pixmap = static_cast<GbmPixmap*>(buffer.get());
if (!pixmap) { if (!pixmap.get()) {
LOG(ERROR) << "ScheduleOverlayPlane passed NULL buffer."; LOG(ERROR) << "ScheduleOverlayPlane passed NULL buffer.";
return false; return false;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment