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

Side by Side Diff: content/common/gpu/image_transport_surface_fbo_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_FBO_MAC_H_ 5 #ifndef CONTENT_COMMON_GPU_IMAGE_TRANSPORT_SURFACE_FBO_MAC_H_
6 #define CONTENT_COMMON_GPU_IMAGE_TRANSPORT_SURFACE_FBO_MAC_H_ 6 #define CONTENT_COMMON_GPU_IMAGE_TRANSPORT_SURFACE_FBO_MAC_H_
7 7
8 #include "base/mac/scoped_cftyperef.h" 8 #include "base/mac/scoped_cftyperef.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "content/common/gpu/gpu_command_buffer_stub.h" 10 #include "content/common/gpu/gpu_command_buffer_stub.h"
(...skipping 16 matching lines...) Expand all
27 class StorageProvider { 27 class StorageProvider {
28 public: 28 public:
29 virtual ~StorageProvider() {} 29 virtual ~StorageProvider() {}
30 // IOSurfaces cause too much address space fragmentation if they are 30 // IOSurfaces cause too much address space fragmentation if they are
31 // allocated on every resize. This gets a rounded size for allocation. 31 // allocated on every resize. This gets a rounded size for allocation.
32 virtual gfx::Size GetRoundedSize(gfx::Size size) = 0; 32 virtual gfx::Size GetRoundedSize(gfx::Size size) = 0;
33 33
34 // Allocate the storage for the color buffer. The specified context is 34 // Allocate the storage for the color buffer. The specified context is
35 // current, and there is a texture bound to GL_TEXTURE_RECTANGLE_ARB. 35 // current, and there is a texture bound to GL_TEXTURE_RECTANGLE_ARB.
36 virtual bool AllocateColorBufferStorage( 36 virtual bool AllocateColorBufferStorage(
37 CGLContextObj context, gfx::Size size) = 0; 37 CGLContextObj context, GLuint texture,
38 gfx::Size size, float scale_factor) = 0;
38 39
39 // Free the storage allocated in the AllocateColorBufferStorage call. The 40 // Free the storage allocated in the AllocateColorBufferStorage call. The
40 // GL texture that was bound has already been deleted by the caller. 41 // GL texture that was bound has already been deleted by the caller.
41 virtual void FreeColorBufferStorage() = 0; 42 virtual void FreeColorBufferStorage() = 0;
42 43
43 // Retrieve the handle for the surface to send to the browser process to 44 // Retrieve the handle for the surface to send to the browser process to
44 // display. 45 // display.
45 virtual uint64 GetSurfaceHandle() const = 0; 46 virtual uint64 GetSurfaceHandle() const = 0;
47
48 // Called when a frame is about to be sent to the browser process.
49 virtual void WillSwapBuffers() = 0;
46 }; 50 };
47 51
48 ImageTransportSurfaceFBO(StorageProvider* storage_provider, 52 ImageTransportSurfaceFBO(StorageProvider* storage_provider,
49 GpuChannelManager* manager, 53 GpuChannelManager* manager,
50 GpuCommandBufferStub* stub, 54 GpuCommandBufferStub* stub,
51 gfx::PluginWindowHandle handle); 55 gfx::PluginWindowHandle handle);
52 56
53 // GLSurface implementation 57 // GLSurface implementation
54 virtual bool Initialize() OVERRIDE; 58 virtual bool Initialize() OVERRIDE;
55 virtual void Destroy() OVERRIDE; 59 virtual void Destroy() OVERRIDE;
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 std::vector<ui::LatencyInfo> latency_info_; 119 std::vector<ui::LatencyInfo> latency_info_;
116 120
117 scoped_ptr<ImageTransportHelper> helper_; 121 scoped_ptr<ImageTransportHelper> helper_;
118 122
119 DISALLOW_COPY_AND_ASSIGN(ImageTransportSurfaceFBO); 123 DISALLOW_COPY_AND_ASSIGN(ImageTransportSurfaceFBO);
120 }; 124 };
121 125
122 } // namespace content 126 } // namespace content
123 127
124 #endif // CONTENT_COMMON_GPU_IMAGE_TRANSPORT_SURFACE_MAC_H_ 128 #endif // CONTENT_COMMON_GPU_IMAGE_TRANSPORT_SURFACE_MAC_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698