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

Side by Side Diff: content/common/gpu/image_transport_surface_iosurface_mac.h

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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_COMMON_GPU_IMAGE_TRANSPORT_SURFACE_IOSURFACE_MAC_H_ 5 #ifndef CONTENT_COMMON_GPU_IMAGE_TRANSPORT_SURFACE_IOSURFACE_MAC_H_
6 #define CONTENT_COMMON_GPU_IMAGE_TRANSPORT_SURFACE_IOSURFACE_MAC_H_ 6 #define CONTENT_COMMON_GPU_IMAGE_TRANSPORT_SURFACE_IOSURFACE_MAC_H_
7 7
8 #include "content/common/gpu/image_transport_surface_fbo_mac.h" 8 #include "content/common/gpu/image_transport_surface_fbo_mac.h"
9 #include "ui/gl/gl_bindings.h" 9 #include "ui/gl/gl_bindings.h"
10 10
11 // Note that this must be included after gl_bindings.h to avoid conflicts. 11 // Note that this must be included after gl_bindings.h to avoid conflicts.
12 #include <OpenGL/CGLIOSurface.h> 12 #include <OpenGL/CGLIOSurface.h>
13 13
14 namespace content { 14 namespace content {
15 15
16 // Allocate IOSurface-backed storage for an FBO image transport surface. 16 // Allocate IOSurface-backed storage for an FBO image transport surface.
17 class IOSurfaceStorageProvider 17 class IOSurfaceStorageProvider
18 : public ImageTransportSurfaceFBO::StorageProvider { 18 : public ImageTransportSurfaceFBO::StorageProvider {
19 public: 19 public:
20 IOSurfaceStorageProvider(); 20 IOSurfaceStorageProvider();
21 virtual ~IOSurfaceStorageProvider(); 21 virtual ~IOSurfaceStorageProvider();
22 22
23 // ImageTransportSurfaceFBO::StorageProvider implementation: 23 // ImageTransportSurfaceFBO::StorageProvider implementation:
24 virtual gfx::Size GetRoundedSize(gfx::Size size) OVERRIDE; 24 virtual gfx::Size GetRoundedSize(gfx::Size size) OVERRIDE;
25 virtual bool AllocateColorBufferStorage( 25 virtual bool AllocateColorBufferStorage(
26 CGLContextObj context, gfx::Size size) OVERRIDE; 26 CGLContextObj context, GLuint texture,
27 gfx::Size pixel_size, float scale_factor) OVERRIDE;
27 virtual void FreeColorBufferStorage() OVERRIDE; 28 virtual void FreeColorBufferStorage() OVERRIDE;
28 virtual uint64 GetSurfaceHandle() const OVERRIDE; 29 virtual uint64 GetSurfaceHandle() const OVERRIDE;
30 virtual void WillSwapBuffers() OVERRIDE;
29 31
30 private: 32 private:
31 base::ScopedCFTypeRef<IOSurfaceRef> io_surface_; 33 base::ScopedCFTypeRef<IOSurfaceRef> io_surface_;
32 34
33 // The id of |io_surface_| or 0 if that's NULL. 35 // The id of |io_surface_| or 0 if that's NULL.
34 IOSurfaceID io_surface_handle_; 36 IOSurfaceID io_surface_id_;
35 37
36 DISALLOW_COPY_AND_ASSIGN(IOSurfaceStorageProvider); 38 DISALLOW_COPY_AND_ASSIGN(IOSurfaceStorageProvider);
37 }; 39 };
38 40
39 } // namespace content 41 } // namespace content
40 42
41 #endif // CONTENT_COMMON_GPU_IMAGE_TRANSPORT_SURFACE_MAC_H_ 43 #endif // CONTENT_COMMON_GPU_IMAGE_TRANSPORT_SURFACE_MAC_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698