diff options
author | gman@google.com <gman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-28 19:57:05 +0000 |
---|---|---|
committer | gman@google.com <gman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-28 19:57:05 +0000 |
commit | 0deb232d6da6dd26a81dde183effaa19db6bf7cd (patch) | |
tree | 4169d5c337e38e951ef3ebe9260794e809b43867 /o3d/core/cross/render_surface_set.h | |
parent | 3c4a6a0b4fffab0126603e207e32632cba40879f (diff) | |
download | chromium_src-0deb232d6da6dd26a81dde183effaa19db6bf7cd.zip chromium_src-0deb232d6da6dd26a81dde183effaa19db6bf7cd.tar.gz chromium_src-0deb232d6da6dd26a81dde183effaa19db6bf7cd.tar.bz2 |
Fixes toDataURL for GL by making it all work through
O3D.
What happens is client.toDataURL creates a RenderSurface
and DepthSurface, sets those as the current Surface
then renders. It then calls Surface::GetBitmap to
get the pixels in the bitmap.
The complications are
1) I needed to make Renderer::StartRendering /
Renderer::FinishRendering be nestable because the
Renderer::SetRenderSurface required StartRendering
to already have been called. I didn't see a cleaner
way to do this but I'm happy to change it if you
have a better idea.
2) Since we can only create POT RenderSurfaces
I added a clip_width / clip_height to render surfaces.
Renderer::SetViewport uses these values so we end up
rendering correctly to the top/left area of the
POT render surface.
3) Doing it this way means that screenshots are NOT
anti-aliased. I feel like that issue can be handled
later. It's more important that toDataURL work now
than it have the ultimate best results. (I hope). It
probably means I'll need to create all new reference
images.
4) I was wondering we we should expose SetClipWidth
to JavaScript. Given that we require POT render surfaces
they should always get the same results on all hardware.
Or, rather, we could just allow the user to create NPOT
RenderSurfaces. Under the hood they'd get a POT surface
but the clip_width/clip_height would be set to the size
the requested. There would have to be a note that texture
wrapping only works if the size if POT.
5) I had to split FinishRendering into FinishRendering
and Present since when taking a screenshot nothing will
be drawn to the backbuffer and so I don't want a
present to happen.
Review URL: http://codereview.chromium.org/174594
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24781 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d/core/cross/render_surface_set.h')
-rw-r--r-- | o3d/core/cross/render_surface_set.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/o3d/core/cross/render_surface_set.h b/o3d/core/cross/render_surface_set.h index 9303bd6..f46e1ab 100644 --- a/o3d/core/cross/render_surface_set.h +++ b/o3d/core/cross/render_surface_set.h @@ -98,8 +98,8 @@ class RenderSurfaceSet : public RenderNode { friend class IClassManager; static ObjectBase::Ref Create(ServiceLocator* service_locator); - RenderSurface* old_render_surface_; - RenderDepthStencilSurface* old_depth_stencil_surface_; + const RenderSurface* old_render_surface_; + const RenderDepthStencilSurface* old_depth_stencil_surface_; ParamRenderSurface::Ref render_surface_param_; ParamRenderDepthStencilSurface::Ref render_depth_stencil_surface_param_; |