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

Side by Side Diff: ui/gfx/surface/accelerated_surface_mac.h

Issue 8678037: Render Core Animation plugins through WebKit's compositor rather than (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 UI_GFX_SURFACE_ACCELERATED_SURFACE_MAC_H_ 5 #ifndef UI_GFX_SURFACE_ACCELERATED_SURFACE_MAC_H_
6 #define UI_GFX_SURFACE_ACCELERATED_SURFACE_MAC_H_ 6 #define UI_GFX_SURFACE_ACCELERATED_SURFACE_MAC_H_
7 #pragma once 7 #pragma once
8 8
9 #include <CoreFoundation/CoreFoundation.h> 9 #include <CoreFoundation/CoreFoundation.h>
10 10
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 gfx::GpuPreference gpu_preference); 57 gfx::GpuPreference gpu_preference);
58 // Tear down. Must be called before destructor to prevent leaks. 58 // Tear down. Must be called before destructor to prevent leaks.
59 void Destroy(); 59 void Destroy();
60 60
61 // These methods are used only once the accelerated surface is initialized. 61 // These methods are used only once the accelerated surface is initialized.
62 62
63 // Sets the accelerated surface to the given size, creating a new one if 63 // Sets the accelerated surface to the given size, creating a new one if
64 // the height or width changes. Returns a unique id of the IOSurface to 64 // the height or width changes. Returns a unique id of the IOSurface to
65 // which the surface is bound, or 0 if no changes were made or an error 65 // which the surface is bound, or 0 if no changes were made or an error
66 // occurred. MakeCurrent() will have been called on the new surface. 66 // occurred. MakeCurrent() will have been called on the new surface.
67 uint64 SetSurfaceSize(const gfx::Size& size); 67 uint32 SetSurfaceSize(const gfx::Size& size);
68 68
69 // Returns the id of this surface's IOSruface, or 0 for 69 // Returns the id of this surface's IOSurface, or 0 for
70 // transport DIB surfaces. 70 // transport DIB surfaces.
71 uint64 GetSurfaceId(); 71 uint32 GetSurfaceId();
72 72
73 // Sets the GL context to be the current one for drawing. Returns true if 73 // Sets the GL context to be the current one for drawing. Returns true if
74 // it succeeded. 74 // it succeeded.
75 bool MakeCurrent(); 75 bool MakeCurrent();
76 // Clear the surface to be transparent. Assumes the caller has already called 76 // Clear the surface to be transparent. Assumes the caller has already called
77 // MakeCurrent(). 77 // MakeCurrent().
78 void Clear(const gfx::Rect& rect); 78 void Clear(const gfx::Rect& rect);
79 // Call after making changes to the surface which require a visual update. 79 // Call after making changes to the surface which require a visual update.
80 // Makes the rendering show up in other processes. Assumes the caller has 80 // Makes the rendering show up in other processes. Assumes the caller has
81 // already called MakeCurrent(). 81 // already called MakeCurrent().
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 scoped_refptr<gfx::GLSurface> gl_surface_; 141 scoped_refptr<gfx::GLSurface> gl_surface_;
142 scoped_refptr<gfx::GLContext> gl_context_; 142 scoped_refptr<gfx::GLContext> gl_context_;
143 // Either |io_surface_| or |transport_dib_| is a valid pointer, but not both. 143 // Either |io_surface_| or |transport_dib_| is a valid pointer, but not both.
144 // |io_surface_| is non-NULL if the IOSurface APIs are supported (Mac OS X 144 // |io_surface_| is non-NULL if the IOSurface APIs are supported (Mac OS X
145 // 10.6 and later). 145 // 10.6 and later).
146 // TODO(dspringer,kbr): Should the GPU backing store be encapsulated in its 146 // TODO(dspringer,kbr): Should the GPU backing store be encapsulated in its
147 // own class so all this implementation detail is hidden? 147 // own class so all this implementation detail is hidden?
148 base::mac::ScopedCFTypeRef<CFTypeRef> io_surface_; 148 base::mac::ScopedCFTypeRef<CFTypeRef> io_surface_;
149 149
150 // The id of |io_surface_| or 0 if that's NULL. 150 // The id of |io_surface_| or 0 if that's NULL.
151 uint64 io_surface_id_; 151 uint32 io_surface_id_;
152 152
153 // TODO(dspringer): If we end up keeping this TransportDIB mechanism, this 153 // TODO(dspringer): If we end up keeping this TransportDIB mechanism, this
154 // should really be a scoped_ptr_malloc<>, with a deallocate functor that 154 // should really be a scoped_ptr_malloc<>, with a deallocate functor that
155 // runs |dib_free_callback_|. I was not able to figure out how to 155 // runs |dib_free_callback_|. I was not able to figure out how to
156 // make this work (or even compile). 156 // make this work (or even compile).
157 scoped_ptr<TransportDIB> transport_dib_; 157 scoped_ptr<TransportDIB> transport_dib_;
158 gfx::Size surface_size_; 158 gfx::Size surface_size_;
159 // It's important to avoid allocating zero-width or zero-height 159 // It's important to avoid allocating zero-width or zero-height
160 // IOSurfaces and textures on the Mac, so we clamp each to a minimum 160 // IOSurfaces and textures on the Mac, so we clamp each to a minimum
161 // of 1. This is the real size of the surface; surface_size_ is what 161 // of 1. This is the real size of the surface; surface_size_ is what
(...skipping 11 matching lines...) Expand all
173 // The FBO and renderbuffer are only allocated if allocate_fbo_ is 173 // The FBO and renderbuffer are only allocated if allocate_fbo_ is
174 // true. 174 // true.
175 GLuint fbo_; 175 GLuint fbo_;
176 GLuint depth_stencil_renderbuffer_; 176 GLuint depth_stencil_renderbuffer_;
177 // Allocate a TransportDIB in the renderer. 177 // Allocate a TransportDIB in the renderer.
178 base::Callback<void(size_t, TransportDIB::Handle*)> dib_alloc_callback_; 178 base::Callback<void(size_t, TransportDIB::Handle*)> dib_alloc_callback_;
179 base::Callback<void(TransportDIB::Id)> dib_free_callback_; 179 base::Callback<void(TransportDIB::Id)> dib_free_callback_;
180 }; 180 };
181 181
182 #endif // UI_GFX_SURFACE_ACCELERATED_SURFACE_MAC_H_ 182 #endif // UI_GFX_SURFACE_ACCELERATED_SURFACE_MAC_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698