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

Side by Side Diff: chrome/browser/renderer_host/accelerated_surface_container_manager_mac.h

Issue 3185004: Cleanups to well-behaved accelerated plugin CL requested by... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 4 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 CHROME_BROWSER_RENDERER_HOST_GPU_PLUGIN_CONTAINER_MANAGER_MAC_H_ 5 #ifndef CHROME_BROWSER_RENDERER_HOST_GPU_PLUGIN_CONTAINER_MANAGER_MAC_H_
6 #define CHROME_BROWSER_RENDERER_HOST_GPU_PLUGIN_CONTAINER_MANAGER_MAC_H_ 6 #define CHROME_BROWSER_RENDERER_HOST_GPU_PLUGIN_CONTAINER_MANAGER_MAC_H_
7 #pragma once 7 #pragma once
8 8
9 #include <OpenGL/OpenGL.h> 9 #include <OpenGL/OpenGL.h>
10 #include <map> 10 #include <map>
(...skipping 16 matching lines...) Expand all
27 AcceleratedSurfaceContainerManagerMac(); 27 AcceleratedSurfaceContainerManagerMac();
28 28
29 // Allocates a new "fake" PluginWindowHandle, which is used as the 29 // Allocates a new "fake" PluginWindowHandle, which is used as the
30 // key for the other operations. 30 // key for the other operations.
31 gfx::PluginWindowHandle AllocateFakePluginWindowHandle(bool opaque, 31 gfx::PluginWindowHandle AllocateFakePluginWindowHandle(bool opaque,
32 bool root); 32 bool root);
33 33
34 // Destroys a fake PluginWindowHandle and associated storage. 34 // Destroys a fake PluginWindowHandle and associated storage.
35 void DestroyFakePluginWindowHandle(gfx::PluginWindowHandle id); 35 void DestroyFakePluginWindowHandle(gfx::PluginWindowHandle id);
36 36
37 // Indicates whether a "root" PluginWindowHandle has been allocated, 37 // Indicates whether the given PluginWindowHandle is "root", which
38 // which means that we are using accelerated compositing and should 38 // means that we are using accelerated compositing and that this one
39 // short-circuit the normal drawing process. 39 // contains the compositor's output.
40 bool IsRootContainer(gfx::PluginWindowHandle id); 40 bool IsRootContainer(gfx::PluginWindowHandle id);
41 41
42 // Sets the size and backing store of the plugin instance. There are two 42 // Sets the size and backing store of the plugin instance. There are two
43 // versions: the IOSurface version is used on systems where the IOSurface 43 // versions: the IOSurface version is used on systems where the IOSurface
44 // API is supported (Mac OS X 10.6 and later); the TransportDIB is used on 44 // API is supported (Mac OS X 10.6 and later); the TransportDIB is used on
45 // Mac OS X 10.5 and earlier. 45 // Mac OS X 10.5 and earlier.
46 void SetSizeAndIOSurface(gfx::PluginWindowHandle id, 46 void SetSizeAndIOSurface(gfx::PluginWindowHandle id,
47 int32 width, 47 int32 width,
48 int32 height, 48 int32 height,
49 uint64 io_surface_identifier); 49 uint64 io_surface_identifier);
50 void SetSizeAndTransportDIB(gfx::PluginWindowHandle id, 50 void SetSizeAndTransportDIB(gfx::PluginWindowHandle id,
51 int32 width, 51 int32 width,
52 int32 height, 52 int32 height,
53 TransportDIB::Handle transport_dib); 53 TransportDIB::Handle transport_dib);
54 54
55 // Takes an update from WebKit about a plugin's position and size and moves 55 // Takes an update from WebKit about a plugin's position and size and moves
56 // the plugin accordingly. 56 // the plugin accordingly.
57 void MovePluginContainer(const webkit_glue::WebPluginGeometry& move); 57 void SetPluginContainerGeometry(const webkit_glue::WebPluginGeometry& move);
58 58
59 // Draws all of the managed plugin containers into the given OpenGL 59 // Draws the plugin container associated with the given id into the given
60 // context, which must already be current. 60 // OpenGL context, which must already be current.
61 void Draw(CGLContextObj context, 61 void Draw(CGLContextObj context,
62 gfx::PluginWindowHandle id, 62 gfx::PluginWindowHandle id,
63 bool draw_root_container); 63 bool draw_root_container);
64 64
65 // Causes the next Draw call on each container to trigger a texture upload. 65 // Causes the next Draw call on each container to trigger a texture upload.
66 // Should be called any time the drawing context has changed. 66 // Should be called any time the drawing context has changed.
67 void ForceTextureReload(); 67 void ForceTextureReload();
68 68
69 // Called by the container to enqueue its OpenGL texture objects for
70 // deletion.
71 void EnqueueTextureForDeletion(GLuint texture);
72
73 private: 69 private:
74 uint32 current_id_; 70 uint32 current_id_;
75 71
76 // Maps a "fake" plugin window handle to the corresponding container. 72 // Maps a "fake" plugin window handle to the corresponding container.
77 AcceleratedSurfaceContainerMac* MapIDToContainer(gfx::PluginWindowHandle id); 73 AcceleratedSurfaceContainerMac* MapIDToContainer(gfx::PluginWindowHandle id);
78 74
79 // A map that associates plugin window handles with their containers. 75 // A map that associates plugin window handles with their containers.
80 typedef std::map<gfx::PluginWindowHandle, AcceleratedSurfaceContainerMac*> 76 typedef std::map<gfx::PluginWindowHandle, AcceleratedSurfaceContainerMac*>
81 PluginWindowToContainerMap; 77 PluginWindowToContainerMap;
82 PluginWindowToContainerMap plugin_window_to_container_map_; 78 PluginWindowToContainerMap plugin_window_to_container_map_;
83 79
84 // The "root" container, which is only used to draw the output of 80 // The "root" container, which is only used to draw the output of
85 // the accelerated compositor if it is active. Currently, 81 // the accelerated compositor if it is active. Currently,
86 // accelerated plugins (Core Animation and Pepper 3D) are drawn on 82 // accelerated plugins (Core Animation and Pepper 3D) are drawn on
87 // top of the page's contents rather than transformed and composited 83 // top of the page's contents rather than transformed and composited
88 // with the rest of the page. At some point we would like them to be 84 // with the rest of the page. At some point we would like them to be
89 // treated uniformly with other page elements; when this is done, 85 // treated uniformly with other page elements; when this is done,
90 // the separate treatment of the root container can go away because 86 // the separate treatment of the root container can go away because
91 // there will only be one container active when the accelerated 87 // there will only be one container active when the accelerated
92 // compositor is active. 88 // compositor is active.
93 AcceleratedSurfaceContainerMac* root_container_; 89 AcceleratedSurfaceContainerMac* root_container_;
94 90
95 // A list of OpenGL textures waiting to be deleted
96 std::vector<GLuint> textures_pending_deletion_;
97
98 DISALLOW_COPY_AND_ASSIGN(AcceleratedSurfaceContainerManagerMac); 91 DISALLOW_COPY_AND_ASSIGN(AcceleratedSurfaceContainerManagerMac);
99 }; 92 };
100 93
101 #endif // CHROME_BROWSER_RENDERER_HOST_GPU_PLUGIN_CONTAINER_MANAGER_MAC_H_ 94 #endif // CHROME_BROWSER_RENDERER_HOST_GPU_PLUGIN_CONTAINER_MANAGER_MAC_H_
102 95
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698