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

Unified Diff: cc/test/test_web_graphics_context_3d.cc

Issue 634083002: gpu: Compositor management of GpuMemoryBuffer instances. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cc-pre-chromium-image-refactor
Patch Set: rebase Created 6 years, 2 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/test/test_web_graphics_context_3d.h ('k') | cc/trees/layer_tree_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..9fae995ec6f8d8d1e6b813b9e7d6de23cfeb051f 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),
@@ -545,51 +544,26 @@ GLboolean TestWebGraphicsContext3D::unmapBufferCHROMIUM(
return true;
}
-GLuint TestWebGraphicsContext3D::createImageCHROMIUM(GLsizei width,
+GLuint TestWebGraphicsContext3D::createImageCHROMIUM(ClientBuffer buffer,
+ 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);
+ base::hash_set<unsigned>& images = namespace_->images;
+ if (!images.count(id))
+ ADD_FAILURE() << "destroyImageCHROMIUM called on unknown image " << id;
+ images.erase(id);
}
GLuint TestWebGraphicsContext3D::createGpuMemoryBufferImageCHROMIUM(
@@ -600,9 +574,8 @@ GLuint TestWebGraphicsContext3D::createGpuMemoryBufferImageCHROMIUM(
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;
}
« no previous file with comments | « cc/test/test_web_graphics_context_3d.h ('k') | cc/trees/layer_tree_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698