Commit 8a59821d authored by lcwu's avatar lcwu Committed by Commit bot

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

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

NOTRY=true

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

Cr-Commit-Position: refs/heads/master@{#293720}
parent 546a02d3
...@@ -41,7 +41,7 @@ scoped_refptr<BitmapCursorOzone> BitmapCursorFactoryOzone::GetBitmapCursor( ...@@ -41,7 +41,7 @@ scoped_refptr<BitmapCursorOzone> BitmapCursorFactoryOzone::GetBitmapCursor(
} }
PlatformCursor BitmapCursorFactoryOzone::GetDefaultCursor(int type) { PlatformCursor BitmapCursorFactoryOzone::GetDefaultCursor(int type) {
return GetDefaultCursorInternal(type); return GetDefaultCursorInternal(type).get();
} }
PlatformCursor BitmapCursorFactoryOzone::CreateImageCursor( PlatformCursor BitmapCursorFactoryOzone::CreateImageCursor(
...@@ -69,9 +69,9 @@ BitmapCursorFactoryOzone::GetDefaultCursorInternal(int type) { ...@@ -69,9 +69,9 @@ BitmapCursorFactoryOzone::GetDefaultCursorInternal(int type) {
// Create new image cursor from default aura bitmap for this type. We hold a // Create new image cursor from default aura bitmap for this type. We hold a
// ref forever because clients do not do refcounting for default cursors. // ref forever because clients do not do refcounting for default cursors.
scoped_refptr<BitmapCursorOzone> cursor = CreateDefaultBitmapCursor(type); scoped_refptr<BitmapCursorOzone> cursor = CreateDefaultBitmapCursor(type);
if (!cursor && type != kCursorPointer) if (!cursor.get() && type != kCursorPointer)
cursor = GetDefaultCursorInternal(kCursorPointer); cursor = GetDefaultCursorInternal(kCursorPointer);
DCHECK(cursor) << "Failed to load default cursor bitmap"; DCHECK(cursor.get()) << "Failed to load default cursor bitmap";
default_cursors_[type] = cursor; default_cursors_[type] = cursor;
} }
......
...@@ -198,7 +198,7 @@ void EventFactoryEvdev::OnDeviceEvent(const DeviceEvent& event) { ...@@ -198,7 +198,7 @@ void EventFactoryEvdev::OnDeviceEvent(const DeviceEvent& event) {
} }
void EventFactoryEvdev::OnDispatcherListChanged() { void EventFactoryEvdev::OnDispatcherListChanged() {
if (!ui_task_runner_) { if (!ui_task_runner_.get()) {
ui_task_runner_ = base::ThreadTaskRunnerHandle::Get(); ui_task_runner_ = base::ThreadTaskRunnerHandle::Get();
// Scan & monitor devices. // Scan & monitor devices.
device_manager_->AddObserver(this); device_manager_->AddObserver(this);
......
...@@ -74,7 +74,7 @@ bool GpuMemoryBufferFactoryOzoneNativeBuffer::CreateGpuMemoryBuffer( ...@@ -74,7 +74,7 @@ bool GpuMemoryBufferFactoryOzoneNativeBuffer::CreateGpuMemoryBuffer(
scoped_refptr<NativePixmap> pixmap = scoped_refptr<NativePixmap> pixmap =
SurfaceFactoryOzone::GetInstance()->CreateNativePixmap( SurfaceFactoryOzone::GetInstance()->CreateNativePixmap(
size, GetOzoneFormatFor(internalformat)); size, GetOzoneFormatFor(internalformat));
if (!pixmap) { if (!pixmap.get()) {
LOG(ERROR) << "Failed to create pixmap " << size.width() << "x" LOG(ERROR) << "Failed to create pixmap " << size.width() << "x"
<< size.height() << " format " << internalformat << ", usage " << size.height() << " format " << internalformat << ", usage "
<< usage; << usage;
......
...@@ -31,7 +31,7 @@ void DriCursor::SetCursor(gfx::AcceleratedWidget widget, ...@@ -31,7 +31,7 @@ void DriCursor::SetCursor(gfx::AcceleratedWidget widget,
return; return;
cursor_ = cursor; cursor_ = cursor;
if (cursor_) if (cursor_.get())
hardware_->SetHardwareCursor( hardware_->SetHardwareCursor(
cursor_window_, cursor_->bitmap(), bitmap_location()); cursor_window_, cursor_->bitmap(), bitmap_location());
else else
...@@ -50,7 +50,7 @@ void DriCursor::MoveCursorTo(gfx::AcceleratedWidget widget, ...@@ -50,7 +50,7 @@ void DriCursor::MoveCursorTo(gfx::AcceleratedWidget widget,
cursor_location_.SetToMax(gfx::PointF(0, 0)); cursor_location_.SetToMax(gfx::PointF(0, 0));
cursor_location_.SetToMin(gfx::PointF(size.width(), size.height())); cursor_location_.SetToMin(gfx::PointF(size.width(), size.height()));
if (cursor_) if (cursor_.get())
hardware_->MoveHardwareCursor(cursor_window_, bitmap_location()); hardware_->MoveHardwareCursor(cursor_window_, bitmap_location());
} }
...@@ -63,7 +63,7 @@ gfx::AcceleratedWidget DriCursor::GetCursorWindow() { ...@@ -63,7 +63,7 @@ gfx::AcceleratedWidget DriCursor::GetCursorWindow() {
} }
bool DriCursor::IsCursorVisible() { bool DriCursor::IsCursorVisible() {
return cursor_; return cursor_.get();
} }
gfx::PointF DriCursor::location() { gfx::PointF DriCursor::location() {
......
...@@ -64,7 +64,7 @@ void DriSurface::ResizeCanvas(const gfx::Size& viewport_size) { ...@@ -64,7 +64,7 @@ void DriSurface::ResizeCanvas(const gfx::Size& viewport_size) {
void DriSurface::PresentCanvas(const gfx::Rect& damage) { void DriSurface::PresentCanvas(const gfx::Rect& damage) {
DCHECK(base::MessageLoopForUI::IsCurrent()); DCHECK(base::MessageLoopForUI::IsCurrent());
DCHECK(buffers_[front_buffer_ ^ 1]); DCHECK(buffers_[front_buffer_ ^ 1].get());
HardwareDisplayController* controller = window_delegate_->GetController(); HardwareDisplayController* controller = window_delegate_->GetController();
if (!controller) if (!controller)
......
...@@ -96,7 +96,7 @@ HardwareDisplayController::~HardwareDisplayController() { ...@@ -96,7 +96,7 @@ HardwareDisplayController::~HardwareDisplayController() {
bool HardwareDisplayController::Modeset(const OverlayPlane& primary, bool HardwareDisplayController::Modeset(const OverlayPlane& primary,
drmModeModeInfo mode) { drmModeModeInfo mode) {
TRACE_EVENT0("dri", "HDC::Modeset"); TRACE_EVENT0("dri", "HDC::Modeset");
DCHECK(primary.buffer); DCHECK(primary.buffer.get());
pending_page_flips_ = 0; pending_page_flips_ = 0;
bool status = true; bool status = true;
for (size_t i = 0; i < crtc_states_.size(); ++i) { for (size_t i = 0; i < crtc_states_.size(); ++i) {
...@@ -117,7 +117,7 @@ bool HardwareDisplayController::Enable() { ...@@ -117,7 +117,7 @@ bool HardwareDisplayController::Enable() {
TRACE_EVENT0("dri", "HDC::Enable"); TRACE_EVENT0("dri", "HDC::Enable");
DCHECK(!current_planes_.empty()); DCHECK(!current_planes_.empty());
OverlayPlane primary = GetPrimaryPlane(current_planes_); OverlayPlane primary = GetPrimaryPlane(current_planes_);
DCHECK(primary.buffer); DCHECK(primary.buffer.get());
pending_page_flips_ = 0; pending_page_flips_ = 0;
bool status = true; bool status = true;
for (size_t i = 0; i < crtc_states_.size(); ++i) for (size_t i = 0; i < crtc_states_.size(); ++i)
...@@ -286,7 +286,7 @@ bool HardwareDisplayController::SchedulePageFlipOnCrtc( ...@@ -286,7 +286,7 @@ bool HardwareDisplayController::SchedulePageFlipOnCrtc(
const OverlayPlaneList& overlays, const OverlayPlaneList& overlays,
CrtcState* state) { CrtcState* state) {
const OverlayPlane& primary = GetPrimaryPlane(overlays); const OverlayPlane& primary = GetPrimaryPlane(overlays);
DCHECK(primary.buffer); DCHECK(primary.buffer.get());
if (primary.buffer->GetSize() != gfx::Size(mode_.hdisplay, mode_.vdisplay)) { if (primary.buffer->GetSize() != gfx::Size(mode_.hdisplay, mode_.vdisplay)) {
LOG(WARNING) << "Trying to pageflip a buffer with the wrong size. Expected " LOG(WARNING) << "Trying to pageflip a buffer with the wrong size. Expected "
......
...@@ -175,7 +175,7 @@ bool ScreenManager::ModesetDisplayController( ...@@ -175,7 +175,7 @@ bool ScreenManager::ModesetDisplayController(
scoped_refptr<ScanoutBuffer> buffer = scoped_refptr<ScanoutBuffer> buffer =
buffer_generator_->Create(gfx::Size(mode.hdisplay, mode.vdisplay)); buffer_generator_->Create(gfx::Size(mode.hdisplay, mode.vdisplay));
if (!buffer) { if (!buffer.get()) {
LOG(ERROR) << "Failed to create scanout buffer"; LOG(ERROR) << "Failed to create scanout 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