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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 // Draws this accelerated surface's contents, texture mapped onto a quad in | 70 // 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 | 71 // the given OpenGL context. TODO(kbr): figure out and define exactly how the |
72 // coordinate system will work out. | 72 // coordinate system will work out. |
73 void Draw(CGLContextObj context); | 73 void Draw(CGLContextObj context); |
74 | 74 |
75 // Causes the next Draw call to trigger a texture upload. Should be called any | 75 // Causes the next Draw call to trigger a texture upload. Should be called any |
76 // time the drawing context has changed. | 76 // time the drawing context has changed. |
77 void ForceTextureReload() { texture_needs_upload_ = true; } | 77 void ForceTextureReload() { texture_needs_upload_ = true; } |
78 | 78 |
79 // Notifies the surface that it was painted to. | 79 // Notifies the surface that it was painted to. |
80 void set_was_painted_to() { was_painted_to_ = true; } | 80 void set_was_painted_to(uint64 surface_id); |
81 | 81 |
82 // Returns if the surface should be shown. | 82 // Returns if the surface should be shown. |
83 bool should_be_visible() const { return visible_ && was_painted_to_; } | 83 bool should_be_visible() const { return visible_ && was_painted_to_; } |
84 private: | 84 private: |
85 // The manager of this accelerated surface container. | 85 // The manager of this accelerated surface container. |
86 AcceleratedSurfaceContainerManagerMac* manager_; | 86 AcceleratedSurfaceContainerManagerMac* manager_; |
87 | 87 |
88 // Whether this accelerated surface's content is supposed to be opaque. | 88 // Whether this accelerated surface's content is supposed to be opaque. |
89 bool opaque_; | 89 bool opaque_; |
90 | 90 |
91 // The IOSurfaceRef, if any, that has been handed from the GPU | 91 // The IOSurfaceRef, if any, that has been handed from the GPU |
92 // plugin process back to the browser process for drawing. | 92 // plugin process back to the browser process for drawing. |
93 // This is held as a CFTypeRef because we can't refer to the | 93 // This is held as a CFTypeRef because we can't refer to the |
94 // IOSurfaceRef type when building on 10.5. | 94 // IOSurfaceRef type when building on 10.5. |
95 base::mac::ScopedCFTypeRef<CFTypeRef> surface_; | 95 base::mac::ScopedCFTypeRef<CFTypeRef> surface_; |
96 | 96 |
| 97 // The id of |surface_|, or 0 if |surface_| is NULL. |
| 98 uint64 surface_id_; |
| 99 |
97 // The TransportDIB which is used in pre-10.6 systems where the IOSurface | 100 // The TransportDIB which is used in pre-10.6 systems where the IOSurface |
98 // API is not supported. This is a weak reference to the actual TransportDIB | 101 // API is not supported. This is a weak reference to the actual TransportDIB |
99 // whic is owned by the GPU process. | 102 // whic is owned by the GPU process. |
100 scoped_ptr<TransportDIB> transport_dib_; | 103 scoped_ptr<TransportDIB> transport_dib_; |
101 | 104 |
102 // The width and height of the surface. | 105 // The width and height of the surface. |
103 int32 width_; | 106 int32 width_; |
104 int32 height_; | 107 int32 height_; |
105 | 108 |
106 // The clip rectangle, relative to the (x_, y_) origin. | 109 // The clip rectangle, relative to the (x_, y_) origin. |
(...skipping 24 matching lines...) Expand all Loading... |
131 void ReleaseIOSurface(); | 134 void ReleaseIOSurface(); |
132 | 135 |
133 // Enqueue our texture for later deletion. | 136 // Enqueue our texture for later deletion. |
134 void EnqueueTextureForDeletion(); | 137 void EnqueueTextureForDeletion(); |
135 | 138 |
136 DISALLOW_COPY_AND_ASSIGN(AcceleratedSurfaceContainerMac); | 139 DISALLOW_COPY_AND_ASSIGN(AcceleratedSurfaceContainerMac); |
137 }; | 140 }; |
138 | 141 |
139 #endif // CHROME_BROWSER_RENDERER_HOST_GPU_PLUGIN_CONTAINER_MAC_H_ | 142 #endif // CHROME_BROWSER_RENDERER_HOST_GPU_PLUGIN_CONTAINER_MAC_H_ |
140 | 143 |
OLD | NEW |