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

Unified Diff: ui/ozone/gpu/gpu_memory_buffer_factory_ozone_native_buffer.cc

Issue 1171513002: Reland of 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
Index: ui/ozone/gpu/gpu_memory_buffer_factory_ozone_native_buffer.cc
diff --git a/ui/ozone/gpu/gpu_memory_buffer_factory_ozone_native_buffer.cc b/ui/ozone/gpu/gpu_memory_buffer_factory_ozone_native_buffer.cc
index df7fca4c62fa16b131e97bbf3294bb62e667d909..babdc6767d6b73391733ef3b1407cf020a2a0ba0 100644
--- a/ui/ozone/gpu/gpu_memory_buffer_factory_ozone_native_buffer.cc
+++ b/ui/ozone/gpu/gpu_memory_buffer_factory_ozone_native_buffer.cc
@@ -8,6 +8,7 @@
#include "ui/gl/gl_image_egl.h"
#include "ui/gl/gl_image_linux_dma_buffer.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"
@@ -35,8 +36,10 @@ class GLImageOzoneNativePixmap : public gfx::GLImageEGL {
gfx::OverlayTransform transform,
const gfx::Rect& bounds_rect,
const gfx::RectF& crop_rect) override {
- return SurfaceFactoryOzone::GetInstance()->ScheduleOverlayPlane(
- widget, z_order, transform, pixmap_, bounds_rect, crop_rect);
+ return OzonePlatform::GetInstance()
+ ->GetSurfaceFactoryOzone()
+ ->ScheduleOverlayPlane(widget, z_order, transform, pixmap_, bounds_rect,
+ crop_rect);
}
protected:
@@ -72,8 +75,10 @@ class GLImageOzoneNativePixmapDmaBuf : public gfx::GLImageLinuxDMABuffer {
gfx::OverlayTransform transform,
const gfx::Rect& bounds_rect,
const gfx::RectF& crop_rect) override {
- return SurfaceFactoryOzone::GetInstance()->ScheduleOverlayPlane(
- widget, z_order, transform, pixmap_, bounds_rect, crop_rect);
+ return OzonePlatform::GetInstance()
+ ->GetSurfaceFactoryOzone()
+ ->ScheduleOverlayPlane(widget, z_order, transform, pixmap_, bounds_rect,
+ crop_rect);
}
protected:
@@ -144,9 +149,10 @@ bool GpuMemoryBufferFactoryOzoneNativeBuffer::CreateGpuMemoryBuffer(
int client_id,
gfx::PluginWindowHandle surface_handle) {
scoped_refptr<NativePixmap> pixmap =
- SurfaceFactoryOzone::GetInstance()->CreateNativePixmap(
- surface_handle, size, GetOzoneFormatFor(format),
- GetOzoneUsageFor(usage));
+ OzonePlatform::GetInstance()
+ ->GetSurfaceFactoryOzone()
+ ->CreateNativePixmap(surface_handle, size, GetOzoneFormatFor(format),
+ GetOzoneUsageFor(usage));
if (!pixmap.get()) {
LOG(ERROR) << "Failed to create pixmap " << size.width() << "x"
<< size.height() << " format " << format << ", usage " << usage;

Powered by Google App Engine
This is Rietveld 408576698