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

Unified Diff: cc/debug/test_web_graphics_context_3d.cc

Issue 22900018: cc: Set the mapped memory reclaim limit for the renderer compositor on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 7 years, 3 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/debug/test_web_graphics_context_3d.h ('k') | cc/output/context_provider.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/debug/test_web_graphics_context_3d.cc
diff --git a/cc/debug/test_web_graphics_context_3d.cc b/cc/debug/test_web_graphics_context_3d.cc
index 04027aedab161eb8b2ee7c4ab1972c41e2ead9da..634778fc4e610eb07802082ac9fc51dc342c6dd4 100644
--- a/cc/debug/test_web_graphics_context_3d.cc
+++ b/cc/debug/test_web_graphics_context_3d.cc
@@ -481,13 +481,16 @@ void TestWebGraphicsContext3D::bufferData(WebKit::WGC3Denum target,
base::ScopedPtrHashMap<unsigned, Buffer>& buffers = namespace_->buffers;
DCHECK_GT(buffers.count(bound_buffer_), 0u);
DCHECK_EQ(target, buffers.get(bound_buffer_)->target);
+ Buffer* buffer = buffers.get(bound_buffer_);
if (context_lost_) {
- buffers.get(bound_buffer_)->pixels.reset();
+ buffer->pixels.reset();
return;
}
- buffers.get(bound_buffer_)->pixels.reset(new uint8[size]);
+
+ buffer->pixels.reset(new uint8[size]);
+ buffer->size = size;
if (data != NULL)
- memcpy(buffers.get(bound_buffer_)->pixels.get(), data, size);
+ memcpy(buffer->pixels.get(), data, size);
}
void* TestWebGraphicsContext3D::mapBufferCHROMIUM(WebKit::WGC3Denum target,
@@ -600,7 +603,25 @@ WebKit::WGC3Duint TestWebGraphicsContext3D::NextImageId() {
return image_id;
}
-TestWebGraphicsContext3D::Buffer::Buffer() : target(0) {}
+size_t TestWebGraphicsContext3D::GetTransferBufferMemoryUsedBytes() const {
+ size_t total_bytes = 0;
+ base::ScopedPtrHashMap<unsigned, Buffer>& buffers = namespace_->buffers;
+ base::ScopedPtrHashMap<unsigned, Buffer>::iterator it = buffers.begin();
+ for (; it != buffers.end(); ++it) {
+ Buffer* buffer = it->second;
+ if (buffer->target == GL_PIXEL_UNPACK_TRANSFER_BUFFER_CHROMIUM)
+ total_bytes += buffer->size;
+ }
+ return total_bytes;
+}
+
+void TestWebGraphicsContext3D::SetMaxTransferBufferUsageBytes(
+ size_t max_transfer_buffer_usage_bytes) {
+ test_capabilities_.max_transfer_buffer_usage_bytes =
+ max_transfer_buffer_usage_bytes;
+}
+
+TestWebGraphicsContext3D::Buffer::Buffer() : target(0), size(0) {}
TestWebGraphicsContext3D::Buffer::~Buffer() {}
« no previous file with comments | « cc/debug/test_web_graphics_context_3d.h ('k') | cc/output/context_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698