OLD | NEW |
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_MAC_H_ | 5 #ifndef CHROME_BROWSER_RENDERER_HOST_GPU_PLUGIN_CONTAINER_MAC_H_ |
6 #define CHROME_BROWSER_RENDERER_HOST_GPU_PLUGIN_CONTAINER_MAC_H_ | 6 #define CHROME_BROWSER_RENDERER_HOST_GPU_PLUGIN_CONTAINER_MAC_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 // The "GPU plugin" is currently implemented as a special kind of | 9 // The "GPU plugin" is currently implemented as a special kind of |
10 // NPAPI plugin to provide high-performance on-screen 3D rendering for | 10 // NPAPI plugin to provide high-performance on-screen 3D rendering for |
(...skipping 18 matching lines...) Expand all Loading... |
29 #include <CoreFoundation/CoreFoundation.h> | 29 #include <CoreFoundation/CoreFoundation.h> |
30 #include <OpenGL/OpenGL.h> | 30 #include <OpenGL/OpenGL.h> |
31 | 31 |
32 #include "app/surface/transport_dib.h" | 32 #include "app/surface/transport_dib.h" |
33 #include "base/basictypes.h" | 33 #include "base/basictypes.h" |
34 #include "base/mac/scoped_cftyperef.h" | 34 #include "base/mac/scoped_cftyperef.h" |
35 #include "base/scoped_ptr.h" | 35 #include "base/scoped_ptr.h" |
36 #include "gfx/native_widget_types.h" | 36 #include "gfx/native_widget_types.h" |
37 #include "gfx/rect.h" | 37 #include "gfx/rect.h" |
38 | 38 |
39 namespace webkit_glue { | 39 namespace webkit { |
| 40 namespace npapi { |
40 struct WebPluginGeometry; | 41 struct WebPluginGeometry; |
41 } | 42 } |
| 43 } |
42 | 44 |
43 class AcceleratedSurfaceContainerManagerMac; | 45 class AcceleratedSurfaceContainerManagerMac; |
44 | 46 |
45 class AcceleratedSurfaceContainerMac { | 47 class AcceleratedSurfaceContainerMac { |
46 public: | 48 public: |
47 AcceleratedSurfaceContainerMac( | 49 AcceleratedSurfaceContainerMac( |
48 AcceleratedSurfaceContainerManagerMac* manager, | 50 AcceleratedSurfaceContainerManagerMac* manager, |
49 bool opaque); | 51 bool opaque); |
50 virtual ~AcceleratedSurfaceContainerMac(); | 52 virtual ~AcceleratedSurfaceContainerMac(); |
51 | 53 |
52 // Sets the backing store and size of this accelerated surface container. | 54 // Sets the backing store and size of this accelerated surface container. |
53 // There are two versions: the IOSurface version is used on systems where the | 55 // There are two versions: the IOSurface version is used on systems where the |
54 // IOSurface API is supported (Mac OS X 10.6 and later); the TransportDIB is | 56 // IOSurface API is supported (Mac OS X 10.6 and later); the TransportDIB is |
55 // used on Mac OS X 10.5 and earlier. | 57 // used on Mac OS X 10.5 and earlier. |
56 void SetSizeAndIOSurface(int32 width, | 58 void SetSizeAndIOSurface(int32 width, |
57 int32 height, | 59 int32 height, |
58 uint64 io_surface_identifier); | 60 uint64 io_surface_identifier); |
59 void SetSizeAndTransportDIB(int32 width, | 61 void SetSizeAndTransportDIB(int32 width, |
60 int32 height, | 62 int32 height, |
61 TransportDIB::Handle transport_dib); | 63 TransportDIB::Handle transport_dib); |
62 | 64 |
63 // Tells the accelerated surface container that its geometry has changed, | 65 // Tells the accelerated surface container that its geometry has changed, |
64 // for example because of a scroll event. (Note that the container | 66 // for example because of a scroll event. (Note that the container |
65 // currently only pays attention to the clip width and height, since the | 67 // currently only pays attention to the clip width and height, since the |
66 // view in which it is hosted is responsible for positioning it on the | 68 // view in which it is hosted is responsible for positioning it on the |
67 // page.) | 69 // page.) |
68 void SetGeometry(const webkit_glue::WebPluginGeometry& geom); | 70 void SetGeometry(const webkit::npapi::WebPluginGeometry& geom); |
69 | 71 |
70 // Draws this accelerated surface's contents, texture mapped onto a quad in | 72 // Draws this accelerated surface's contents, texture mapped onto a quad in |
71 // the given OpenGL context. TODO(kbr): figure out and define exactly how the | 73 // the given OpenGL context. TODO(kbr): figure out and define exactly how the |
72 // coordinate system will work out. | 74 // coordinate system will work out. |
73 void Draw(CGLContextObj context); | 75 void Draw(CGLContextObj context); |
74 | 76 |
75 // Causes the next Draw call to trigger a texture upload. Should be called any | 77 // Causes the next Draw call to trigger a texture upload. Should be called any |
76 // time the drawing context has changed. | 78 // time the drawing context has changed. |
77 void ForceTextureReload() { texture_needs_upload_ = true; } | 79 void ForceTextureReload() { texture_needs_upload_ = true; } |
78 | 80 |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 void ReleaseIOSurface(); | 144 void ReleaseIOSurface(); |
143 | 145 |
144 // Enqueue our texture for later deletion. | 146 // Enqueue our texture for later deletion. |
145 void EnqueueTextureForDeletion(); | 147 void EnqueueTextureForDeletion(); |
146 | 148 |
147 DISALLOW_COPY_AND_ASSIGN(AcceleratedSurfaceContainerMac); | 149 DISALLOW_COPY_AND_ASSIGN(AcceleratedSurfaceContainerMac); |
148 }; | 150 }; |
149 | 151 |
150 #endif // CHROME_BROWSER_RENDERER_HOST_GPU_PLUGIN_CONTAINER_MAC_H_ | 152 #endif // CHROME_BROWSER_RENDERER_HOST_GPU_PLUGIN_CONTAINER_MAC_H_ |
151 | 153 |
OLD | NEW |