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

Unified Diff: content/common/gpu/image_transport_surface_iosurface_mac.cc

Issue 347653005: Make cross-process CALayers work on Mac (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@image_transport_1
Patch Set: Incorporate review feedback Created 6 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: content/common/gpu/image_transport_surface_iosurface_mac.cc
diff --git a/content/common/gpu/image_transport_surface_iosurface_mac.cc b/content/common/gpu/image_transport_surface_iosurface_mac.cc
index 5d0dded9287a8abd49d9a1533f07db9a83760a24..49aa4cda74dbc32fe7e271bb617d344723c7a43c 100644
--- a/content/common/gpu/image_transport_surface_iosurface_mac.cc
+++ b/content/common/gpu/image_transport_surface_iosurface_mac.cc
@@ -5,6 +5,7 @@
#include "content/common/gpu/image_transport_surface_iosurface_mac.h"
#include "content/common/gpu/gpu_messages.h"
+#include "content/common/gpu/surface_handle_types_mac.h"
namespace content {
namespace {
@@ -51,8 +52,8 @@ gfx::Size IOSurfaceStorageProvider::GetRoundedSize(gfx::Size size) {
}
bool IOSurfaceStorageProvider::AllocateColorBufferStorage(
- CGLContextObj context,
- gfx::Size size) {
+ CGLContextObj context, GLuint texture,
+ gfx::Size pixel_size, float scale_factor) {
// Allocate a new IOSurface, which is the GPU resource that can be
// shared across processes.
base::ScopedCFTypeRef<CFMutableDictionaryRef> properties;
@@ -62,10 +63,10 @@ bool IOSurfaceStorageProvider::AllocateColorBufferStorage(
&kCFTypeDictionaryValueCallBacks));
AddIntegerValue(properties,
kIOSurfaceWidth,
- size.width());
+ pixel_size.width());
AddIntegerValue(properties,
kIOSurfaceHeight,
- size.height());
+ pixel_size.height());
AddIntegerValue(properties,
kIOSurfaceBytesPerElement, 4);
AddBooleanValue(properties,
@@ -74,7 +75,7 @@ bool IOSurfaceStorageProvider::AllocateColorBufferStorage(
// synchronizing with the browser process because they are
// ultimately reference counted by the operating system.
io_surface_.reset(IOSurfaceCreate(properties));
- io_surface_handle_ = IOSurfaceGetID(io_surface_);
+ io_surface_id_ = IOSurfaceGetID(io_surface_);
// Don't think we need to identify a plane.
GLuint plane = 0;
@@ -82,8 +83,8 @@ bool IOSurfaceStorageProvider::AllocateColorBufferStorage(
context,
GL_TEXTURE_RECTANGLE_ARB,
GL_RGBA,
- size.width(),
- size.height(),
+ pixel_size.width(),
+ pixel_size.height(),
GL_BGRA,
GL_UNSIGNED_INT_8_8_8_8_REV,
io_surface_.get(),
@@ -99,11 +100,14 @@ bool IOSurfaceStorageProvider::AllocateColorBufferStorage(
void IOSurfaceStorageProvider::FreeColorBufferStorage() {
io_surface_.reset();
- io_surface_handle_ = 0;
+ io_surface_id_ = 0;
}
uint64 IOSurfaceStorageProvider::GetSurfaceHandle() const {
- return io_surface_handle_;
+ return SurfaceHandleFromIOSurfaceID(io_surface_id_);
+}
+
+void IOSurfaceStorageProvider::WillSwapBuffers() {
}
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698