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 <windows.h> | 5 #include <windows.h> |
6 | 6 |
7 #include "gpu/command_buffer/service/gpu_processor.h" | 7 #include "gpu/command_buffer/service/gpu_processor.h" |
8 | 8 |
9 using ::base::SharedMemory; | 9 using ::base::SharedMemory; |
10 | 10 |
11 namespace command_buffer { | 11 namespace command_buffer { |
12 | 12 |
13 GPUProcessor::GPUProcessor(NPP npp, CommandBuffer* command_buffer) | 13 GPUProcessor::GPUProcessor(CommandBuffer* command_buffer) |
14 : npp_(npp), | 14 : command_buffer_(command_buffer), |
15 command_buffer_(command_buffer), | |
16 commands_per_update_(100) { | 15 commands_per_update_(100) { |
17 DCHECK(command_buffer); | 16 DCHECK(command_buffer); |
18 decoder_.reset(gles2::GLES2Decoder::Create()); | 17 decoder_.reset(gles2::GLES2Decoder::Create()); |
19 decoder_->set_engine(this); | 18 decoder_->set_engine(this); |
20 } | 19 } |
21 | 20 |
22 GPUProcessor::GPUProcessor(CommandBuffer* command_buffer, | 21 GPUProcessor::GPUProcessor(CommandBuffer* command_buffer, |
23 gles2::GLES2Decoder* decoder, | 22 gles2::GLES2Decoder* decoder, |
24 CommandParser* parser, | 23 CommandParser* parser, |
25 int commands_per_update) | 24 int commands_per_update) |
26 : npp_(NULL), | 25 : command_buffer_(command_buffer), |
27 command_buffer_(command_buffer), | |
28 commands_per_update_(commands_per_update) { | 26 commands_per_update_(commands_per_update) { |
29 DCHECK(command_buffer); | 27 DCHECK(command_buffer); |
30 decoder_.reset(decoder); | 28 decoder_.reset(decoder); |
31 parser_.reset(parser); | 29 parser_.reset(parser); |
32 } | 30 } |
33 | 31 |
34 bool GPUProcessor::Initialize(HWND handle) { | 32 bool GPUProcessor::Initialize(HWND handle) { |
35 DCHECK(handle); | 33 DCHECK(handle); |
36 | 34 |
37 // Cannot reinitialize. | 35 // Cannot reinitialize. |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 if (handle == NULL) { | 69 if (handle == NULL) { |
72 // Destroy GAPI when the window handle becomes invalid. | 70 // Destroy GAPI when the window handle becomes invalid. |
73 Destroy(); | 71 Destroy(); |
74 return true; | 72 return true; |
75 } else { | 73 } else { |
76 return Initialize(handle); | 74 return Initialize(handle); |
77 } | 75 } |
78 } | 76 } |
79 | 77 |
80 } // namespace command_buffer | 78 } // namespace command_buffer |
OLD | NEW |