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

Side by Side Diff: gpu/demos/framework/plugin.cc

Issue 553050: Windows now uses the TLS API instead of __declspec(thread) for client side co... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 11 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "gpu/demos/framework/plugin.h" 5 #include "gpu/demos/framework/plugin.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "gpu/demos/framework/demo_factory.h" 8 #include "gpu/demos/framework/demo_factory.h"
9 9
10 namespace { 10 namespace {
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 85
86 Plugin::Plugin(NPP npp) 86 Plugin::Plugin(NPP npp)
87 : npp_(npp), 87 : npp_(npp),
88 device3d_(NULL), 88 device3d_(NULL),
89 pgl_context_(NULL), 89 pgl_context_(NULL),
90 demo_(CreateDemo()) { 90 demo_(CreateDemo()) {
91 memset(&context3d_, 0, sizeof(context3d_)); 91 memset(&context3d_, 0, sizeof(context3d_));
92 } 92 }
93 93
94 Plugin::~Plugin() { 94 Plugin::~Plugin() {
95 // Destroy demo while GL context is current and before it is destroyed.
96 pglMakeCurrent(pgl_context_);
97 demo_.reset();
alokp 2010/01/27 05:30:19 may be demo_.release() is clearer.
95 pglMakeCurrent(NULL); 98 pglMakeCurrent(NULL);
99
96 pglDestroyContext(pgl_context_); 100 pglDestroyContext(pgl_context_);
97 } 101 }
98 102
99 NPClass* Plugin::GetPluginClass() { 103 NPClass* Plugin::GetPluginClass() {
100 return &plugin_class; 104 return &plugin_class;
101 } 105 }
102 106
103 void Plugin::New(NPMIMEType pluginType, 107 void Plugin::New(NPMIMEType pluginType,
104 int16 argc, char* argn[], char* argv[]) { 108 int16 argc, char* argn[], char* argv[]) {
105 if (!g_extensions) { 109 if (!g_extensions) {
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 demo_->Draw(); 142 demo_->Draw();
139 pglSwapBuffers(); 143 pglSwapBuffers();
140 pglMakeCurrent(NULL); 144 pglMakeCurrent(NULL);
141 145
142 // Schedule another call to Paint. 146 // Schedule another call to Paint.
143 g_browser->pluginthreadasynccall(npp_, PaintCallback, this); 147 g_browser->pluginthreadasynccall(npp_, PaintCallback, this);
144 } 148 }
145 149
146 } // namespace demos 150 } // namespace demos
147 } // namespace gpu 151 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698