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

Unified Diff: ui/gl/gl_surface_ozone.cc

Issue 1167533007: Revert of ozone: Remove singleton pattern for SurfaceFactoryOzone. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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/gl/gl_surface_egl.cc ('k') | ui/ozone/demo/software_renderer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gl_surface_ozone.cc
diff --git a/ui/gl/gl_surface_ozone.cc b/ui/gl/gl_surface_ozone.cc
index c7783588ddf87159ea7824c081ee0672d8623293..3b2e76a05765dfacc60ce1c6e893c9ec119bb27d 100644
--- a/ui/gl/gl_surface_ozone.cc
+++ b/ui/gl/gl_surface_ozone.cc
@@ -23,7 +23,6 @@
#include "ui/gl/scoped_binders.h"
#include "ui/gl/scoped_make_current.h"
#include "ui/ozone/public/native_pixmap.h"
-#include "ui/ozone/public/ozone_platform.h"
#include "ui/ozone/public/surface_factory_ozone.h"
#include "ui/ozone/public/surface_ozone_egl.h"
@@ -119,8 +118,7 @@
}
Destroy();
- ozone_surface_ = ui::OzonePlatform::GetInstance()
- ->GetSurfaceFactoryOzone()
+ ozone_surface_ = ui::SurfaceFactoryOzone::GetInstance()
->CreateEGLSurfaceForWidget(widget_)
.Pass();
if (!ozone_surface_) {
@@ -480,10 +478,8 @@
gfx::OverlayTransform transform,
const gfx::Rect& bounds_rect,
const gfx::RectF& crop_rect) {
- return ui::OzonePlatform::GetInstance()
- ->GetSurfaceFactoryOzone()
- ->ScheduleOverlayPlane(widget, z_order, transform, pixmap_, bounds_rect,
- crop_rect);
+ return ui::SurfaceFactoryOzone::GetInstance()->ScheduleOverlayPlane(
+ widget, z_order, transform, pixmap_, bounds_rect, crop_rect);
}
GLSurfaceOzoneSurfacelessSurfaceImpl::SurfaceImage::~SurfaceImage() {
@@ -588,11 +584,9 @@
return true;
for (size_t i = 0; i < arraysize(textures_); i++) {
scoped_refptr<ui::NativePixmap> pixmap =
- ui::OzonePlatform::GetInstance()
- ->GetSurfaceFactoryOzone()
- ->CreateNativePixmap(widget_, GetSize(),
- ui::SurfaceFactoryOzone::BGRA_8888,
- ui::SurfaceFactoryOzone::SCANOUT);
+ ui::SurfaceFactoryOzone::GetInstance()->CreateNativePixmap(
+ widget_, GetSize(), ui::SurfaceFactoryOzone::BGRA_8888,
+ ui::SurfaceFactoryOzone::SCANOUT);
if (!pixmap)
return false;
scoped_refptr<SurfaceImage> image =
@@ -634,12 +628,9 @@
if (GetGLImplementation() == kGLImplementationEGLGLES2 &&
window != kNullAcceleratedWidget &&
GLSurfaceEGL::IsEGLSurfacelessContextSupported() &&
- ui::OzonePlatform::GetInstance()
- ->GetSurfaceFactoryOzone()
- ->CanShowPrimaryPlaneAsOverlay()) {
+ ui::SurfaceFactoryOzone::GetInstance()->CanShowPrimaryPlaneAsOverlay()) {
scoped_ptr<ui::SurfaceOzoneEGL> surface_ozone =
- ui::OzonePlatform::GetInstance()
- ->GetSurfaceFactoryOzone()
+ ui::SurfaceFactoryOzone::GetInstance()
->CreateSurfacelessEGLSurfaceForWidget(window);
if (!surface_ozone)
return nullptr;
@@ -665,12 +656,10 @@
if (window != kNullAcceleratedWidget) {
scoped_refptr<GLSurface> surface;
if (GLSurfaceEGL::IsEGLSurfacelessContextSupported() &&
- ui::OzonePlatform::GetInstance()
- ->GetSurfaceFactoryOzone()
+ ui::SurfaceFactoryOzone::GetInstance()
->CanShowPrimaryPlaneAsOverlay()) {
scoped_ptr<ui::SurfaceOzoneEGL> surface_ozone =
- ui::OzonePlatform::GetInstance()
- ->GetSurfaceFactoryOzone()
+ ui::SurfaceFactoryOzone::GetInstance()
->CreateSurfacelessEGLSurfaceForWidget(window);
if (!surface_ozone)
return NULL;
@@ -678,9 +667,8 @@
window);
} else {
scoped_ptr<ui::SurfaceOzoneEGL> surface_ozone =
- ui::OzonePlatform::GetInstance()
- ->GetSurfaceFactoryOzone()
- ->CreateEGLSurfaceForWidget(window);
+ ui::SurfaceFactoryOzone::GetInstance()->CreateEGLSurfaceForWidget(
+ window);
if (!surface_ozone)
return NULL;
@@ -730,9 +718,7 @@
}
EGLNativeDisplayType GetPlatformDefaultEGLNativeDisplay() {
- return ui::OzonePlatform::GetInstance()
- ->GetSurfaceFactoryOzone()
- ->GetNativeDisplay();
+ return ui::SurfaceFactoryOzone::GetInstance()->GetNativeDisplay();
}
} // namespace gfx
« no previous file with comments | « ui/gl/gl_surface_egl.cc ('k') | ui/ozone/demo/software_renderer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698