Commit d985f9a5 authored by Dean Liao's avatar Dean Liao Committed by Commit Bot

media/gpu/test: Add LOG_ASSERT to make sure pointers are valid.

LOG_ASSERT() platform and factory pointers in case they are null.

BUG=None
TEST=None

Change-Id: If40e3cfffcd64a15de0010f7cd57e987b1955023
Reviewed-on: https://chromium-review.googlesource.com/c/1352122Reviewed-by: default avatarHirokazu Honda <hiroh@chromium.org>
Commit-Queue: Shuo-Peng Liao <deanliao@google.com>
Cr-Commit-Position: refs/heads/master@{#611988}
parent 58cab433
......@@ -10,6 +10,7 @@
#if defined(OS_CHROMEOS)
#include <libdrm/drm_fourcc.h>
#include "base/logging.h"
#include "media/gpu/format_utils.h"
#include "ui/gfx/buffer_format_util.h"
#include "ui/gfx/native_pixmap.h"
......@@ -51,7 +52,9 @@ scoped_refptr<TextureRef> TextureRef::CreatePreallocated(
LOG_ASSERT(texture_ref);
ui::OzonePlatform* platform = ui::OzonePlatform::GetInstance();
LOG_ASSERT(platform);
ui::SurfaceFactoryOzone* factory = platform->GetSurfaceFactoryOzone();
LOG_ASSERT(factory);
gfx::BufferFormat buffer_format =
VideoPixelFormatToGfxBufferFormat(pixel_format);
texture_ref->pixmap_ = factory->CreateNativePixmap(
......
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