| OLD | NEW |
| 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 NPBrowser::get()->RetainObject(this); | 82 NPBrowser::get()->RetainObject(this); |
| 83 return this; | 83 return this; |
| 84 } | 84 } |
| 85 | 85 |
| 86 NPObjectPointer<NPObject> GPUPluginObject::OpenCommandBuffer() { | 86 NPObjectPointer<NPObject> GPUPluginObject::OpenCommandBuffer() { |
| 87 if (command_buffer_.Get()) | 87 if (command_buffer_.Get()) |
| 88 return command_buffer_; | 88 return command_buffer_; |
| 89 | 89 |
| 90 command_buffer_ = NPCreateObject<CommandBuffer>(npp_); | 90 command_buffer_ = NPCreateObject<CommandBuffer>(npp_); |
| 91 if (command_buffer_->Initialize(kCommandBufferSize)) { | 91 if (command_buffer_->Initialize(kCommandBufferSize)) { |
| 92 processor_ = new GPUProcessor(command_buffer_); | 92 processor_ = new GPUProcessor(npp_, command_buffer_); |
| 93 command_buffer_->SetPutOffsetChangeCallback( | 93 if (processor_->Initialize(static_cast<HWND>(window_.window))) { |
| 94 NewCallback(processor_.get(), | 94 command_buffer_->SetPutOffsetChangeCallback( |
| 95 &GPUProcessor::ProcessCommands)); | 95 NewCallback(processor_.get(), |
| 96 UpdateProcessorWindow(); | 96 &GPUProcessor::ProcessCommands)); |
| 97 return command_buffer_; | 97 UpdateProcessorWindow(); |
| 98 return command_buffer_; |
| 99 } |
| 98 } | 100 } |
| 99 | 101 |
| 102 processor_ = NULL; |
| 100 command_buffer_ = NPObjectPointer<CommandBuffer>(); | 103 command_buffer_ = NPObjectPointer<CommandBuffer>(); |
| 101 return command_buffer_; | 104 return command_buffer_; |
| 102 } | 105 } |
| 103 | 106 |
| 104 } // namespace gpu_plugin | 107 } // namespace gpu_plugin |
| 105 } // namespace o3d | 108 } // namespace o3d |
| OLD | NEW |