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

Unified Diff: gpu/demos/framework/window.cc

Issue 9699048: Make Occlusion Query Sample (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: make it more C++y Created 8 years, 9 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 | « gpu/demos/framework/window.h ('k') | gpu/demos/framework/window_linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/demos/framework/window.cc
diff --git a/gpu/demos/framework/window.cc b/gpu/demos/framework/window.cc
index c20a55a29fc3f6ad751411d302da850315e24505..87ae5364c38c993f247a0e0addf6d3ff768048a7 100644
--- a/gpu/demos/framework/window.cc
+++ b/gpu/demos/framework/window.cc
@@ -36,6 +36,13 @@ Window::Window()
}
Window::~Window() {
+ demo_.reset();
+
+ // must free client before service.
+ gles2_implementation_.reset();
+ transfer_buffer_.reset();
+ gles2_cmd_helper_.reset();
+
if (decoder_.get()) {
decoder_->Destroy();
}
@@ -108,15 +115,15 @@ bool Window::CreateRenderContext(gfx::AcceleratedWidget hwnd) {
transfer_buffer_.reset(new gpu::TransferBuffer(gles2_cmd_helper_.get()));
::gles2::Initialize();
- GLES2Implementation* gles2_implementation = new GLES2Implementation(
+ gles2_implementation_.reset(new GLES2Implementation(
gles2_cmd_helper_.get(),
transfer_buffer_.get(),
false,
- true);
+ true));
- ::gles2::SetGLContext(gles2_implementation);
+ ::gles2::SetGLContext(gles2_implementation_.get());
- if (!gles2_implementation->Initialize(
+ if (!gles2_implementation_->Initialize(
kTransferBufferSize,
kTransferBufferSize,
kTransferBufferSize)) {
« no previous file with comments | « gpu/demos/framework/window.h ('k') | gpu/demos/framework/window_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698