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

Unified Diff: ui/gfx/mac/io_surface.cc

Issue 1532813002: Replace IOSurfaceManager by directly passing IOSurface Mach ports over Chrome IPC. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Windows compile Created 5 years 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/gfx/mac/io_surface.cc
diff --git a/ui/gfx/mac/io_surface_manager.cc b/ui/gfx/mac/io_surface.cc
similarity index 89%
rename from ui/gfx/mac/io_surface_manager.cc
rename to ui/gfx/mac/io_surface.cc
index 580196eee77b607b8e5d6edf3a74f9aae2f9c663..7d9767f2b593fca62228a234205e6b527c656673 100644
--- a/ui/gfx/mac/io_surface_manager.cc
+++ b/ui/gfx/mac/io_surface.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "ui/gfx/mac/io_surface_manager.h"
+#include "ui/gfx/mac/io_surface.h"
#include <IOSurface/IOSurface.h>
@@ -13,8 +13,6 @@
namespace gfx {
namespace {
-IOSurfaceManager* g_instance = NULL;
-
void AddIntegerValue(CFMutableDictionaryRef dictionary,
const CFStringRef key,
int32 value) {
@@ -86,21 +84,7 @@ int32 PixelFormat(gfx::BufferFormat format) {
} // namespace
-// static
-IOSurfaceManager* IOSurfaceManager::GetInstance() {
- DCHECK(g_instance);
- return g_instance;
-}
-
-// static
-void IOSurfaceManager::SetInstance(IOSurfaceManager* instance) {
- DCHECK(!g_instance || !instance);
- g_instance = instance;
-}
-
-// static
-IOSurfaceRef IOSurfaceManager::CreateIOSurface(const gfx::Size& size,
- gfx::BufferFormat format) {
+IOSurfaceRef CreateIOSurface(const gfx::Size& size, gfx::BufferFormat format) {
size_t num_planes = gfx::NumberOfPlanesForBufferFormat(format);
base::ScopedCFTypeRef<CFMutableArrayRef> planes(CFArrayCreateMutable(
kCFAllocatorDefault, num_planes, &kCFTypeArrayCallBacks));

Powered by Google App Engine
This is Rietveld 408576698