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

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

Issue 712343003: Infrastructure for temportarily relinquishing GPU resources. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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
Index: content/common/gpu/gpu_channel_manager.cc
diff --git a/content/common/gpu/gpu_channel_manager.cc b/content/common/gpu/gpu_channel_manager.cc
index a073e20151edce4dc033a6d9e54bf3c0196b214a..951db9a3eac7f37bd1a12e1f2c153e45d84d132a 100644
--- a/content/common/gpu/gpu_channel_manager.cc
+++ b/content/common/gpu/gpu_channel_manager.cc
@@ -103,10 +103,7 @@ GpuChannelManager::GpuChannelManager(MessageRouter* router,
GpuChannelManager::~GpuChannelManager() {
gpu_channels_.clear();
- if (default_offscreen_surface_.get()) {
- default_offscreen_surface_->Destroy();
- default_offscreen_surface_ = NULL;
- }
+ OnDeleteDefaultOffscreenSurface();
jbauman 2014/11/12 01:47:28 This shouldn't be necessary, as it'll be deleted a
GusFernandez 2014/11/15 02:11:56 See below.
}
gpu::gles2::ProgramCache* GpuChannelManager::program_cache() {
@@ -162,6 +159,8 @@ bool GpuChannelManager::OnMessageReceived(const IPC::Message& msg) {
OnCreateViewCommandBuffer)
IPC_MESSAGE_HANDLER(GpuMsg_DestroyGpuMemoryBuffer, OnDestroyGpuMemoryBuffer)
IPC_MESSAGE_HANDLER(GpuMsg_LoadedShader, OnLoadedShader)
+ IPC_MESSAGE_HANDLER(GpuMsg_DeleteDefaultOffscreenSurface,
+ OnDeleteDefaultOffscreenSurface)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
return handled;
@@ -323,4 +322,11 @@ gfx::GLSurface* GpuChannelManager::GetDefaultOffscreenSurface() {
return default_offscreen_surface_.get();
}
+void GpuChannelManager::OnDeleteDefaultOffscreenSurface() {
+ if (default_offscreen_surface_.get()) {
+ default_offscreen_surface_->Destroy();
jbauman 2014/11/12 01:47:28 This Destroy should be unnecessary, as it'll be ca
GusFernandez 2014/11/15 02:11:56 The whole point is to release the default_offscree
+ default_offscreen_surface_ = NULL;
+ }
+}
+
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698