summaryrefslogtreecommitdiffstats
path: root/o3d
diff options
context:
space:
mode:
authoramarinichev@chromium.org <amarinichev@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-27 17:52:16 +0000
committeramarinichev@chromium.org <amarinichev@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-27 17:52:16 +0000
commit504c9a7249e41dacd91bc1bd4426f717911f879d (patch)
tree13936c350f6672f3f21eb1d189215e090888f572 /o3d
parentc901f6d2d0289da9526bf775349edd1dbb876c80 (diff)
downloadchromium_src-504c9a7249e41dacd91bc1bd4426f717911f879d.zip
chromium_src-504c9a7249e41dacd91bc1bd4426f717911f879d.tar.gz
chromium_src-504c9a7249e41dacd91bc1bd4426f717911f879d.tar.bz2
Pulled changes from issue 669220 to fix building with renderer=gles2.
Review URL: http://codereview.chromium.org/1741009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45723 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d')
-rw-r--r--o3d/core/cross/gles2/render_surface_gles2.cc13
-rw-r--r--o3d/core/cross/gles2/render_surface_gles2.h4
-rw-r--r--o3d/core/cross/gles2/texture_gles2.cc1
3 files changed, 10 insertions, 8 deletions
diff --git a/o3d/core/cross/gles2/render_surface_gles2.cc b/o3d/core/cross/gles2/render_surface_gles2.cc
index 6d21dc8..02b2ee3 100644
--- a/o3d/core/cross/gles2/render_surface_gles2.cc
+++ b/o3d/core/cross/gles2/render_surface_gles2.cc
@@ -54,13 +54,14 @@ RenderSurfaceGLES2::RenderSurfaceGLES2(ServiceLocator *service_locator,
RenderSurfaceGLES2::~RenderSurfaceGLES2() {
}
-Bitmap::Ref RenderSurfaceGLES2::PlatformSpecificGetBitmap() const {
+bool RenderSurfaceGLES2::PlatformSpecificGetIntoBitmap(
+ Bitmap::Ref bitmap) const {
Renderer* renderer = service_locator()->GetService<Renderer>();
DCHECK(renderer);
-
- Bitmap::Ref bitmap = Bitmap::Ref(new Bitmap(service_locator()));
- bitmap->Allocate(
- Texture::ARGB8, clip_width(), clip_height(), 1, Bitmap::IMAGE);
+ DCHECK(bitmap->width() == static_cast<unsigned int>(clip_width()) &&
+ bitmap->height() == static_cast<unsigned int>(clip_height()) &&
+ bitmap->num_mipmaps() == 1 &&
+ bitmap->format() == Texture::ARGB8);
const RenderSurface* old_render_surface;
const RenderDepthStencilSurface* old_depth_surface;
@@ -76,7 +77,7 @@ Bitmap::Ref RenderSurfaceGLES2::PlatformSpecificGetBitmap() const {
renderer->SetRenderSurfaces(old_render_surface, old_depth_surface,
old_is_back_buffer);
- return bitmap;
+ return true;
}
RenderDepthStencilSurfaceGLES2::RenderDepthStencilSurfaceGLES2(
diff --git a/o3d/core/cross/gles2/render_surface_gles2.h b/o3d/core/cross/gles2/render_surface_gles2.h
index 820647c..df5825b 100644
--- a/o3d/core/cross/gles2/render_surface_gles2.h
+++ b/o3d/core/cross/gles2/render_surface_gles2.h
@@ -74,8 +74,8 @@ class RenderSurfaceGLES2 : public RenderSurface {
}
protected:
- // The platform specific part of GetBitmap.
- virtual Bitmap::Ref PlatformSpecificGetBitmap() const;
+ // The platform specific part of GetIntoBitmap.
+ virtual bool PlatformSpecificGetIntoBitmap(Bitmap::Ref bitmap) const;
private:
GLenum cube_face_;
diff --git a/o3d/core/cross/gles2/texture_gles2.cc b/o3d/core/cross/gles2/texture_gles2.cc
index dcb652d..b4da4e8 100644
--- a/o3d/core/cross/gles2/texture_gles2.cc
+++ b/o3d/core/cross/gles2/texture_gles2.cc
@@ -319,6 +319,7 @@ Texture2DGLES2* Texture2DGLES2::Create(ServiceLocator* service_locator,
bool enable_render_surfaces) {
DLOG(INFO) << "Texture2DGLES2 Create";
DCHECK_NE(format, Texture::UNKNOWN_FORMAT);
+ DCHECK_GE(levels, 0);
RendererGLES2 *renderer = static_cast<RendererGLES2 *>(
service_locator->GetService<Renderer>());
renderer->MakeCurrentLazy();