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

Unified Diff: ui/ozone/platform/drm/gbm_surface_factory.cc

Issue 1068723005: ozone: Clarify All SurfaceFactoryOzone APIs except for CreateNativePixmap() must be used on the mai… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rollback unrelated changes Created 5 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/ozone/platform/drm/drm_surface_factory.cc ('k') | ui/ozone/platform/egltest/ozone_platform_egltest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « ui/ozone/platform/drm/drm_surface_factory.cc ('k') | ui/ozone/platform/egltest/ozone_platform_egltest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698