| Index: ui/ozone/platform/drm/gbm_surface_factory.cc
|
| diff --git a/ui/ozone/platform/drm/gbm_surface_factory.cc b/ui/ozone/platform/drm/gbm_surface_factory.cc
|
| index afe8d2cb6644f929ee2bda09965fbf291c5e95f6..f81d74631b52d7eb40056a8426869f830cd2cdda 100644
|
| --- a/ui/ozone/platform/drm/gbm_surface_factory.cc
|
| +++ b/ui/ozone/platform/drm/gbm_surface_factory.cc
|
| @@ -78,6 +78,7 @@ GbmSurfaceFactory::GbmSurfaceFactory(bool allow_surfaceless)
|
| }
|
|
|
| GbmSurfaceFactory::~GbmSurfaceFactory() {
|
| + DCHECK(thread_checker_.CalledOnValidThread());
|
| }
|
|
|
| void GbmSurfaceFactory::InitializeGpu(DrmDeviceManager* drm_device_manager,
|
| @@ -87,11 +88,13 @@ void GbmSurfaceFactory::InitializeGpu(DrmDeviceManager* drm_device_manager,
|
| }
|
|
|
| intptr_t GbmSurfaceFactory::GetNativeDisplay() {
|
| + DCHECK(thread_checker_.CalledOnValidThread());
|
| return EGL_DEFAULT_DISPLAY;
|
| }
|
|
|
| const int32* GbmSurfaceFactory::GetEGLSurfaceProperties(
|
| const int32* desired_list) {
|
| + DCHECK(thread_checker_.CalledOnValidThread());
|
| static const int32 kConfigAttribs[] = {EGL_BUFFER_SIZE,
|
| 32,
|
| EGL_ALPHA_SIZE,
|
| @@ -114,17 +117,20 @@ const int32* GbmSurfaceFactory::GetEGLSurfaceProperties(
|
| bool GbmSurfaceFactory::LoadEGLGLES2Bindings(
|
| AddGLLibraryCallback add_gl_library,
|
| SetGLGetProcAddressProcCallback set_gl_get_proc_address) {
|
| + DCHECK(thread_checker_.CalledOnValidThread());
|
| return LoadDefaultEGLGLES2Bindings(add_gl_library, set_gl_get_proc_address);
|
| }
|
|
|
| scoped_ptr<SurfaceOzoneCanvas> GbmSurfaceFactory::CreateCanvasForWidget(
|
| gfx::AcceleratedWidget widget) {
|
| + DCHECK(thread_checker_.CalledOnValidThread());
|
| LOG(FATAL) << "Software rendering mode is not supported with GBM platform";
|
| return nullptr;
|
| }
|
|
|
| scoped_ptr<SurfaceOzoneEGL> GbmSurfaceFactory::CreateEGLSurfaceForWidget(
|
| gfx::AcceleratedWidget widget) {
|
| + DCHECK(thread_checker_.CalledOnValidThread());
|
| scoped_refptr<GbmDevice> gbm = GetGbmDevice(widget);
|
| DCHECK(gbm);
|
|
|
| @@ -139,6 +145,7 @@ scoped_ptr<SurfaceOzoneEGL> GbmSurfaceFactory::CreateEGLSurfaceForWidget(
|
| scoped_ptr<SurfaceOzoneEGL>
|
| GbmSurfaceFactory::CreateSurfacelessEGLSurfaceForWidget(
|
| gfx::AcceleratedWidget widget) {
|
| + DCHECK(thread_checker_.CalledOnValidThread());
|
| if (!allow_surfaceless_)
|
| return nullptr;
|
|
|
| @@ -171,6 +178,7 @@ scoped_refptr<ui::NativePixmap> GbmSurfaceFactory::CreateNativePixmap(
|
|
|
| OverlayCandidatesOzone* GbmSurfaceFactory::GetOverlayCandidates(
|
| gfx::AcceleratedWidget w) {
|
| + DCHECK(thread_checker_.CalledOnValidThread());
|
| if (base::CommandLine::ForCurrentProcess()->HasSwitch(
|
| switches::kOzoneTestSingleOverlaySupport))
|
| return new SingleOverlay();
|
| @@ -184,6 +192,7 @@ bool GbmSurfaceFactory::ScheduleOverlayPlane(
|
| scoped_refptr<NativePixmap> buffer,
|
| const gfx::Rect& display_bounds,
|
| const gfx::RectF& crop_rect) {
|
| + DCHECK(thread_checker_.CalledOnValidThread());
|
| scoped_refptr<GbmPixmap> pixmap = static_cast<GbmPixmap*>(buffer.get());
|
| if (!pixmap.get()) {
|
| LOG(ERROR) << "ScheduleOverlayPlane passed NULL buffer.";
|
| @@ -196,10 +205,12 @@ bool GbmSurfaceFactory::ScheduleOverlayPlane(
|
| }
|
|
|
| bool GbmSurfaceFactory::CanShowPrimaryPlaneAsOverlay() {
|
| + DCHECK(thread_checker_.CalledOnValidThread());
|
| return allow_surfaceless_;
|
| }
|
|
|
| bool GbmSurfaceFactory::CanCreateNativePixmap(BufferUsage usage) {
|
| + DCHECK(thread_checker_.CalledOnValidThread());
|
| switch (usage) {
|
| case MAP:
|
| return false;
|
|
|