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

Unified Diff: ui/ozone/platform/egltest/ozone_platform_egltest.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/gbm_surface_factory.cc ('k') | ui/ozone/platform/test/test_window_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/ozone/platform/egltest/ozone_platform_egltest.cc
diff --git a/ui/ozone/platform/egltest/ozone_platform_egltest.cc b/ui/ozone/platform/egltest/ozone_platform_egltest.cc
index 42ce0a8d6e768c1935c61e89c997000e6c6f9db1..adfadf99bba9cdd9e0fd62ea6e6f4d5b657107e1 100644
--- a/ui/ozone/platform/egltest/ozone_platform_egltest.cc
+++ b/ui/ozone/platform/egltest/ozone_platform_egltest.cc
@@ -9,6 +9,7 @@
#include "base/environment.h"
#include "base/files/file_path.h"
#include "base/path_service.h"
+#include "base/threading/thread_checker.h"
#include "library_loaders/libeglplatform_shim.h"
#include "third_party/khronos/EGL/egl.h"
#include "ui/events/devices/device_data_manager.h"
@@ -240,7 +241,9 @@ class SurfaceFactoryEgltest : public ui::SurfaceFactoryOzone {
public:
SurfaceFactoryEgltest(LibeglplatformShimLoader* eglplatform_shim)
: eglplatform_shim_(eglplatform_shim) {}
- ~SurfaceFactoryEgltest() override {}
+ ~SurfaceFactoryEgltest() override {
+ DCHECK(thread_checker_.CalledOnValidThread());
+ }
// SurfaceFactoryOzone:
intptr_t GetNativeDisplay() override;
@@ -253,14 +256,17 @@ class SurfaceFactoryEgltest : public ui::SurfaceFactoryOzone {
private:
LibeglplatformShimLoader* eglplatform_shim_;
+ base::ThreadChecker thread_checker_;
};
intptr_t SurfaceFactoryEgltest::GetNativeDisplay() {
+ DCHECK(thread_checker_.CalledOnValidThread());
return eglplatform_shim_->ShimGetNativeDisplay();
}
scoped_ptr<SurfaceOzoneEGL> SurfaceFactoryEgltest::CreateEGLSurfaceForWidget(
gfx::AcceleratedWidget widget) {
+ DCHECK(thread_checker_.CalledOnValidThread());
return make_scoped_ptr<SurfaceOzoneEGL>(
new SurfaceOzoneEgltest(widget, eglplatform_shim_));
}
@@ -268,6 +274,7 @@ scoped_ptr<SurfaceOzoneEGL> SurfaceFactoryEgltest::CreateEGLSurfaceForWidget(
bool SurfaceFactoryEgltest::LoadEGLGLES2Bindings(
AddGLLibraryCallback add_gl_library,
SetGLGetProcAddressProcCallback set_gl_get_proc_address) {
+ DCHECK(thread_checker_.CalledOnValidThread());
const char* egl_soname = eglplatform_shim_->ShimQueryString(SHIM_EGL_LIBRARY);
const char* gles_soname =
eglplatform_shim_->ShimQueryString(SHIM_GLES_LIBRARY);
@@ -282,6 +289,7 @@ bool SurfaceFactoryEgltest::LoadEGLGLES2Bindings(
const int32* SurfaceFactoryEgltest::GetEGLSurfaceProperties(
const int32* desired_list) {
+ DCHECK(thread_checker_.CalledOnValidThread());
static const int32 broken_props[] = {
EGL_RENDERABLE_TYPE,
EGL_OPENGL_ES2_BIT,
« no previous file with comments | « ui/ozone/platform/drm/gbm_surface_factory.cc ('k') | ui/ozone/platform/test/test_window_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698