| Index: cc/test/test_web_graphics_context_3d.cc
|
| diff --git a/cc/test/test_web_graphics_context_3d.cc b/cc/test/test_web_graphics_context_3d.cc
|
| index ccca7db8c7617bd0c4b9663fa24418ca4e8235b8..6bc26b766272d5cfffa0181c25ea4997079b22ed 100644
|
| --- a/cc/test/test_web_graphics_context_3d.cc
|
| +++ b/cc/test/test_web_graphics_context_3d.cc
|
| @@ -53,7 +53,6 @@ TestWebGraphicsContext3D::TestWebGraphicsContext3D()
|
| times_bind_texture_succeeds_(-1),
|
| times_end_query_succeeds_(-1),
|
| context_lost_(false),
|
| - times_map_image_chromium_succeeds_(-1),
|
| times_map_buffer_chromium_succeeds_(-1),
|
| current_used_transfer_buffer_usage_bytes_(0),
|
| max_used_transfer_buffer_usage_bytes_(0),
|
| @@ -547,63 +546,23 @@ GLboolean TestWebGraphicsContext3D::unmapBufferCHROMIUM(
|
|
|
| GLuint TestWebGraphicsContext3D::createImageCHROMIUM(GLsizei width,
|
| GLsizei height,
|
| - GLenum internalformat,
|
| - GLenum usage) {
|
| - DCHECK_EQ(GL_RGBA8_OES, static_cast<int>(internalformat));
|
| + GLenum internalformat) {
|
| + DCHECK_EQ(GL_RGBA, static_cast<int>(internalformat));
|
| GLuint image_id = NextImageId();
|
| base::AutoLock lock(namespace_->lock);
|
| - base::ScopedPtrHashMap<unsigned, Image>& images = namespace_->images;
|
| - images.set(image_id, make_scoped_ptr(new Image).Pass());
|
| - images.get(image_id)->pixels.reset(new uint8[width * height * 4]);
|
| + base::hash_set<unsigned>& images = namespace_->images;
|
| + images.insert(image_id);
|
| return image_id;
|
| }
|
|
|
| void TestWebGraphicsContext3D::destroyImageCHROMIUM(
|
| GLuint id) {
|
| RetireImageId(id);
|
| -}
|
| -
|
| -void TestWebGraphicsContext3D::getImageParameterivCHROMIUM(
|
| - GLuint image_id,
|
| - GLenum pname,
|
| - GLint* params) {
|
| - base::AutoLock lock(namespace_->lock);
|
| - DCHECK_GT(namespace_->images.count(image_id), 0u);
|
| - DCHECK_EQ(GL_IMAGE_ROWBYTES_CHROMIUM, static_cast<int>(pname));
|
| - *params = 0;
|
| -}
|
| -
|
| -void* TestWebGraphicsContext3D::mapImageCHROMIUM(GLuint image_id) {
|
| base::AutoLock lock(namespace_->lock);
|
| - base::ScopedPtrHashMap<unsigned, Image>& images = namespace_->images;
|
| - DCHECK_GT(images.count(image_id), 0u);
|
| - if (times_map_image_chromium_succeeds_ >= 0) {
|
| - if (!times_map_image_chromium_succeeds_) {
|
| - return NULL;
|
| - }
|
| - --times_map_image_chromium_succeeds_;
|
| - }
|
| - return images.get(image_id)->pixels.get();
|
| -}
|
| -
|
| -void TestWebGraphicsContext3D::unmapImageCHROMIUM(
|
| - GLuint image_id) {
|
| - base::AutoLock lock(namespace_->lock);
|
| - DCHECK_GT(namespace_->images.count(image_id), 0u);
|
| -}
|
| -
|
| -GLuint TestWebGraphicsContext3D::createGpuMemoryBufferImageCHROMIUM(
|
| - GLsizei width,
|
| - GLsizei height,
|
| - GLenum internalformat,
|
| - GLenum usage) {
|
| - DCHECK_EQ(GL_RGBA, static_cast<int>(internalformat));
|
| - GLuint image_id = NextImageId();
|
| - base::AutoLock lock(namespace_->lock);
|
| - base::ScopedPtrHashMap<unsigned, Image>& images = namespace_->images;
|
| - images.set(image_id, make_scoped_ptr(new Image).Pass());
|
| - images.get(image_id)->pixels.reset(new uint8[width * height * 4]);
|
| - return image_id;
|
| + base::hash_set<unsigned>& images = namespace_->images;
|
| + if (!images.count(id))
|
| + ADD_FAILURE() << "destroyImageCHROMIUM called on unknown image " << id;
|
| + images.erase(id);
|
| }
|
|
|
| unsigned TestWebGraphicsContext3D::insertSyncPoint() {
|
|
|