summaryrefslogtreecommitdiffstats
path: root/app/surface/accelerated_surface_mac.h
diff options
context:
space:
mode:
authorapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-09 21:16:02 +0000
committerapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-09 21:16:02 +0000
commitd37231fa18e0978822c6aa2c9d03e7a56e61810b (patch)
tree2765f8b09fe2f23a667cc1c0fb821d384a35dbd0 /app/surface/accelerated_surface_mac.h
parent7b70a92006d329a3e2df40ec6b61322212f75d95 (diff)
downloadchromium_src-d37231fa18e0978822c6aa2c9d03e7a56e61810b.zip
chromium_src-d37231fa18e0978822c6aa2c9d03e7a56e61810b.tar.gz
chromium_src-d37231fa18e0978822c6aa2c9d03e7a56e61810b.tar.bz2
- Extracted platform specific code from GLES2 command decoder to platform specific GLContext classes.
- GLContext encapsulates management of GL contexts on each platform. - ReadPixels uses actual current window size to validate source rectangle. TEST=trybots, running Pepper 3D and WebGL demos on all platforms BUG=none Review URL: http://codereview.chromium.org/1605014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44129 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'app/surface/accelerated_surface_mac.h')
-rw-r--r--app/surface/accelerated_surface_mac.h15
1 files changed, 10 insertions, 5 deletions
diff --git a/app/surface/accelerated_surface_mac.h b/app/surface/accelerated_surface_mac.h
index 32cd0df..3808dcd 100644
--- a/app/surface/accelerated_surface_mac.h
+++ b/app/surface/accelerated_surface_mac.h
@@ -12,6 +12,8 @@
#include "base/callback.h"
#include "base/scoped_cftyperef.h"
#include "base/scoped_ptr.h"
+#include "gfx/rect.h"
+#include "gfx/size.h"
namespace gfx {
class Rect;
@@ -38,7 +40,8 @@ class AcceleratedSurface {
// the height or width changes. Returns a unique id of the IOSurface to
// which the surface is bound, or 0 if no changes were made or an error
// occurred. MakeCurrent() will have been called on the new surface.
- uint64 SetSurfaceSize(int32 width, int32 height);
+ uint64 SetSurfaceSize(const gfx::Size& size);
+
// Sets the GL context to be the current one for drawing. Returns true if
// it succeeded.
bool MakeCurrent();
@@ -55,18 +58,21 @@ class AcceleratedSurface {
// Sets the transport DIB to the given size, creating a new one if the
// height or width changes. Returns a handle to the new DIB, or a default
// handle if no changes were made.
- TransportDIB::Handle SetTransportDIBSize(int32 width, int32 height);
+ TransportDIB::Handle SetTransportDIBSize(const gfx::Size& size);
// Sets the methods to use for allocating and freeing memory for the
// transport DIB.
void SetTransportDIBAllocAndFree(
Callback2<size_t, TransportDIB::Handle*>::Type* allocator,
Callback1<TransportDIB::Id>::Type* deallocator);
+ // Get the accelerated surface size.
+ gfx::Size GetSize() const { return surface_size_; }
+
private:
// Helper function to generate names for the backing texture, render buffers
// and FBO. On return, the resulting buffer names can be attached to |fbo_|.
// |target| is the target type for the color buffer.
- void AllocateRenderBuffers(GLenum target, int32 width, int32 height);
+ void AllocateRenderBuffers(GLenum target, const gfx::Size& size);
// Helper function to attach the buffers previously allocated by a call to
// AllocateRenderBuffers(). On return, |fbo_| can be used for
@@ -88,8 +94,7 @@ class AcceleratedSurface {
// runs |dib_free_callback_|. I was not able to figure out how to
// make this work (or even compile).
scoped_ptr<TransportDIB> transport_dib_;
- int32 surface_width_;
- int32 surface_height_;
+ gfx::Size surface_size_;
GLuint texture_;
GLuint fbo_;
GLuint depth_stencil_renderbuffer_;