Commit 04efaed9 authored by fwang's avatar fwang Committed by Commit bot

Rename GbmSurfaceFactory::drm_thread_ to GbmSurfaceFactory::drm_thread_proxy_

R=rjkroege@chromium.org
BUG=none

Review-Url: https://codereview.chromium.org/2393913002
Cr-Commit-Position: refs/heads/master@{#423812}
parent 10494e2f
...@@ -33,20 +33,24 @@ namespace { ...@@ -33,20 +33,24 @@ namespace {
class GLOzoneEGLGbm : public GLOzoneEGL { class GLOzoneEGLGbm : public GLOzoneEGL {
public: public:
GLOzoneEGLGbm(GbmSurfaceFactory* surface_factory, DrmThreadProxy* drm_thread) GLOzoneEGLGbm(GbmSurfaceFactory* surface_factory,
: surface_factory_(surface_factory), drm_thread_(drm_thread) {} DrmThreadProxy* drm_thread_proxy)
: surface_factory_(surface_factory),
drm_thread_proxy_(drm_thread_proxy) {}
~GLOzoneEGLGbm() override {} ~GLOzoneEGLGbm() override {}
scoped_refptr<gl::GLSurface> CreateViewGLSurface( scoped_refptr<gl::GLSurface> CreateViewGLSurface(
gfx::AcceleratedWidget window) override { gfx::AcceleratedWidget window) override {
return gl::InitializeGLSurface(new GbmSurface( return gl::InitializeGLSurface(new GbmSurface(
surface_factory_, drm_thread_->CreateDrmWindowProxy(window), window)); surface_factory_, drm_thread_proxy_->CreateDrmWindowProxy(window),
window));
} }
scoped_refptr<gl::GLSurface> CreateSurfacelessViewGLSurface( scoped_refptr<gl::GLSurface> CreateSurfacelessViewGLSurface(
gfx::AcceleratedWidget window) override { gfx::AcceleratedWidget window) override {
return gl::InitializeGLSurface(new GbmSurfaceless( return gl::InitializeGLSurface(new GbmSurfaceless(
surface_factory_, drm_thread_->CreateDrmWindowProxy(window), window)); surface_factory_, drm_thread_proxy_->CreateDrmWindowProxy(window),
window));
} }
scoped_refptr<gl::GLSurface> CreateOffscreenGLSurface( scoped_refptr<gl::GLSurface> CreateOffscreenGLSurface(
...@@ -63,16 +67,16 @@ class GLOzoneEGLGbm : public GLOzoneEGL { ...@@ -63,16 +67,16 @@ class GLOzoneEGLGbm : public GLOzoneEGL {
private: private:
GbmSurfaceFactory* surface_factory_; GbmSurfaceFactory* surface_factory_;
DrmThreadProxy* drm_thread_; DrmThreadProxy* drm_thread_proxy_;
DISALLOW_COPY_AND_ASSIGN(GLOzoneEGLGbm); DISALLOW_COPY_AND_ASSIGN(GLOzoneEGLGbm);
}; };
} // namespace } // namespace
GbmSurfaceFactory::GbmSurfaceFactory(DrmThreadProxy* drm_thread) GbmSurfaceFactory::GbmSurfaceFactory(DrmThreadProxy* drm_thread_proxy)
: egl_implementation_(new GLOzoneEGLGbm(this, drm_thread)), : egl_implementation_(new GLOzoneEGLGbm(this, drm_thread_proxy)),
drm_thread_(drm_thread) {} drm_thread_proxy_(drm_thread_proxy) {}
GbmSurfaceFactory::~GbmSurfaceFactory() { GbmSurfaceFactory::~GbmSurfaceFactory() {
DCHECK(thread_checker_.CalledOnValidThread()); DCHECK(thread_checker_.CalledOnValidThread());
...@@ -126,7 +130,7 @@ std::unique_ptr<SurfaceOzoneCanvas> GbmSurfaceFactory::CreateCanvasForWidget( ...@@ -126,7 +130,7 @@ std::unique_ptr<SurfaceOzoneCanvas> GbmSurfaceFactory::CreateCanvasForWidget(
std::vector<gfx::BufferFormat> GbmSurfaceFactory::GetScanoutFormats( std::vector<gfx::BufferFormat> GbmSurfaceFactory::GetScanoutFormats(
gfx::AcceleratedWidget widget) { gfx::AcceleratedWidget widget) {
std::vector<gfx::BufferFormat> scanout_formats; std::vector<gfx::BufferFormat> scanout_formats;
drm_thread_->GetScanoutFormats(widget, &scanout_formats); drm_thread_proxy_->GetScanoutFormats(widget, &scanout_formats);
return scanout_formats; return scanout_formats;
} }
...@@ -142,7 +146,7 @@ scoped_refptr<ui::NativePixmap> GbmSurfaceFactory::CreateNativePixmap( ...@@ -142,7 +146,7 @@ scoped_refptr<ui::NativePixmap> GbmSurfaceFactory::CreateNativePixmap(
#endif #endif
scoped_refptr<GbmBuffer> buffer = scoped_refptr<GbmBuffer> buffer =
drm_thread_->CreateBuffer(widget, size, format, usage); drm_thread_proxy_->CreateBuffer(widget, size, format, usage);
if (!buffer.get()) if (!buffer.get())
return nullptr; return nullptr;
...@@ -170,7 +174,7 @@ scoped_refptr<ui::NativePixmap> GbmSurfaceFactory::CreateNativePixmapFromHandle( ...@@ -170,7 +174,7 @@ scoped_refptr<ui::NativePixmap> GbmSurfaceFactory::CreateNativePixmapFromHandle(
planes.push_back(plane); planes.push_back(plane);
} }
scoped_refptr<GbmBuffer> buffer = drm_thread_->CreateBufferFromFds( scoped_refptr<GbmBuffer> buffer = drm_thread_proxy_->CreateBufferFromFds(
widget, size, format, std::move(scoped_fds), planes); widget, size, format, std::move(scoped_fds), planes);
if (!buffer) if (!buffer)
return nullptr; return nullptr;
......
...@@ -26,7 +26,7 @@ class GbmSurfaceless; ...@@ -26,7 +26,7 @@ class GbmSurfaceless;
class GbmSurfaceFactory : public SurfaceFactoryOzone { class GbmSurfaceFactory : public SurfaceFactoryOzone {
public: public:
explicit GbmSurfaceFactory(DrmThreadProxy* drm_thread); explicit GbmSurfaceFactory(DrmThreadProxy* drm_thread_proxy);
~GbmSurfaceFactory() override; ~GbmSurfaceFactory() override;
void RegisterSurface(gfx::AcceleratedWidget widget, GbmSurfaceless* surface); void RegisterSurface(gfx::AcceleratedWidget widget, GbmSurfaceless* surface);
...@@ -57,7 +57,7 @@ class GbmSurfaceFactory : public SurfaceFactoryOzone { ...@@ -57,7 +57,7 @@ class GbmSurfaceFactory : public SurfaceFactoryOzone {
base::ThreadChecker thread_checker_; base::ThreadChecker thread_checker_;
DrmThreadProxy* drm_thread_; DrmThreadProxy* drm_thread_proxy_;
std::map<gfx::AcceleratedWidget, GbmSurfaceless*> widget_to_surface_map_; std::map<gfx::AcceleratedWidget, GbmSurfaceless*> widget_to_surface_map_;
......
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