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

Unified Diff: content/common/gpu/gpu_command_buffer_stub.cc

Issue 10083056: GpuMemoryManager suggests values for renderer Contents Texture Managers' preferred memory limit. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: On max 10.5, it fails to init command buffer, and my callback code didn't guard against that. Created 8 years, 8 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 | « content/common/gpu/gpu_command_buffer_stub.h ('k') | content/common/gpu/gpu_memory_allocation.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/gpu/gpu_command_buffer_stub.cc
diff --git a/content/common/gpu/gpu_command_buffer_stub.cc b/content/common/gpu/gpu_command_buffer_stub.cc
index b6f6d289627a49715f2376aa0b30315eda97e26f..11deb700f893ccfc1eb6622cea86781b2cf818e8 100644
--- a/content/common/gpu/gpu_command_buffer_stub.cc
+++ b/content/common/gpu/gpu_command_buffer_stub.cc
@@ -58,7 +58,9 @@ GpuCommandBufferStub::GpuCommandBufferStub(
route_id_(route_id),
software_(software),
last_flush_count_(0),
- allocation_(GpuMemoryAllocation::INVALID_RESOURCE_SIZE, true, true),
+ allocation_(GpuMemoryAllocation::INVALID_RESOURCE_SIZE,
+ GpuMemoryAllocation::kHasFrontbuffer |
+ GpuMemoryAllocation::kHasBackbuffer),
parent_stub_for_initialization_(),
parent_texture_for_initialization_(0),
watchdog_(watchdog) {
@@ -130,6 +132,9 @@ bool GpuCommandBufferStub::OnMessageReceived(const IPC::Message& message) {
OnDiscardBackbuffer)
IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_EnsureBackbuffer,
OnEnsureBackbuffer)
+ IPC_MESSAGE_HANDLER(
+ GpuCommandBufferMsg_SetClientHasMemoryAllocationChangedCallback,
+ OnSetClientHasMemoryAllocationChangedCallback)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
@@ -588,6 +593,12 @@ void GpuCommandBufferStub::OnEnsureBackbuffer() {
gfx::GLSurface::BUFFER_ALLOCATION_FRONT_AND_BACK);
}
+void GpuCommandBufferStub::OnSetClientHasMemoryAllocationChangedCallback(
+ bool has_callback) {
+ client_has_memory_allocation_changed_callback_ = has_callback;
+ channel_->gpu_channel_manager()->gpu_memory_manager()->ScheduleManage();
+}
+
void GpuCommandBufferStub::SendConsoleMessage(
int32 id,
const std::string& message) {
@@ -616,6 +627,11 @@ bool GpuCommandBufferStub::IsInSameContextShareGroup(
static_cast<const GpuCommandBufferStub&>(other).context_group_;
}
+bool GpuCommandBufferStub::
+ client_has_memory_allocation_changed_callback() const {
+ return client_has_memory_allocation_changed_callback_;
+}
+
bool GpuCommandBufferStub::has_surface_state() const {
return surface_state_ != NULL;
}
« no previous file with comments | « content/common/gpu/gpu_command_buffer_stub.h ('k') | content/common/gpu/gpu_memory_allocation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698