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

Side by Side Diff: o3d/gpu_plugin/gpu_plugin_object.cc

Issue 344001: GPUPluginObject has methods to query its current window size.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « o3d/gpu_plugin/gpu_plugin_object.h ('k') | o3d/gpu_plugin/gpu_plugin_object_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 <stdlib.h> 5 #include <stdlib.h>
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "o3d/gpu_plugin/np_utils/np_utils.h" 8 #include "o3d/gpu_plugin/np_utils/np_utils.h"
9 #include "o3d/gpu_plugin/gpu_plugin_object.h" 9 #include "o3d/gpu_plugin/gpu_plugin_object.h"
10 #include "o3d/gpu_plugin/gpu_processor.h" 10 #include "o3d/gpu_plugin/gpu_processor.h"
(...skipping 26 matching lines...) Expand all
37 } 37 }
38 38
39 NPError GPUPluginObject::SetWindow(NPWindow* new_window) { 39 NPError GPUPluginObject::SetWindow(NPWindow* new_window) {
40 if (status_ == kWaitingForNew || status_ == kDestroyed) 40 if (status_ == kWaitingForNew || status_ == kDestroyed)
41 return NPERR_GENERIC_ERROR; 41 return NPERR_GENERIC_ERROR;
42 42
43 // PlatformSpecificSetWindow advances the status depending on what happens. 43 // PlatformSpecificSetWindow advances the status depending on what happens.
44 NPError error = PlatformSpecificSetWindow(new_window); 44 NPError error = PlatformSpecificSetWindow(new_window);
45 if (error == NPERR_NO_ERROR) { 45 if (error == NPERR_NO_ERROR) {
46 window_ = *new_window; 46 window_ = *new_window;
47
48 if (event_sync_.Get()) {
49 NPInvokeVoid(npp_,
50 event_sync_,
51 "resize",
52 static_cast<int32>(window_.width),
53 static_cast<int32>(window_.height));
54 }
47 } else { 55 } else {
48 memset(&window_, 0, sizeof(window_)); 56 memset(&window_, 0, sizeof(window_));
49 } 57 }
50 58
51 return error; 59 return error;
52 } 60 }
53 61
54 int16 GPUPluginObject::HandleEvent(NPEvent* event) { 62 int16 GPUPluginObject::HandleEvent(NPEvent* event) {
55 return 0; 63 return 0;
56 } 64 }
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 status_ = kInitializationSuccessful; 129 status_ = kInitializationSuccessful;
122 return command_buffer_; 130 return command_buffer_;
123 } 131 }
124 } 132 }
125 133
126 return NPObjectPointer<CommandBuffer>(); 134 return NPObjectPointer<CommandBuffer>();
127 } 135 }
128 136
129 } // namespace gpu_plugin 137 } // namespace gpu_plugin
130 } // namespace o3d 138 } // namespace o3d
OLDNEW
« no previous file with comments | « o3d/gpu_plugin/gpu_plugin_object.h ('k') | o3d/gpu_plugin/gpu_plugin_object_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698