Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/command_buffer/service/gpu_processor.h" | 5 #include "gpu/command_buffer/service/gpu_processor.h" |
| 6 | 6 |
| 7 #include "app/gfx/gl/gl_bindings.h" | 7 #include "app/gfx/gl/gl_bindings.h" |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 47 decoder_.reset(decoder); | 47 decoder_.reset(decoder); |
| 48 parser_.reset(parser); | 48 parser_.reset(parser); |
| 49 } | 49 } |
| 50 | 50 |
| 51 GPUProcessor::~GPUProcessor() { | 51 GPUProcessor::~GPUProcessor() { |
| 52 Destroy(); | 52 Destroy(); |
| 53 } | 53 } |
| 54 | 54 |
| 55 bool GPUProcessor::InitializeCommon(gfx::GLContext* context, | 55 bool GPUProcessor::InitializeCommon(gfx::GLContext* context, |
| 56 const gfx::Size& size, | 56 const gfx::Size& size, |
| 57 const gles2::DisallowedExtensions& disallowe d, | |
|
apatrick_chromium
2011/03/07 22:31:40
80 char limit
| |
| 57 const char* allowed_extensions, | 58 const char* allowed_extensions, |
| 58 const std::vector<int32>& attribs, | 59 const std::vector<int32>& attribs, |
| 59 gles2::GLES2Decoder* parent_decoder, | 60 gles2::GLES2Decoder* parent_decoder, |
| 60 uint32 parent_texture_id) { | 61 uint32 parent_texture_id) { |
| 61 DCHECK(context); | 62 DCHECK(context); |
| 62 | 63 |
| 63 if (!context->MakeCurrent()) | 64 if (!context->MakeCurrent()) |
| 64 return false; | 65 return false; |
| 65 | 66 |
| 66 // If the NV_fence extension is present, use fences to defer the issue of | 67 // If the NV_fence extension is present, use fences to defer the issue of |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 83 0, | 84 0, |
| 84 decoder_.get())); | 85 decoder_.get())); |
| 85 } else { | 86 } else { |
| 86 parser_.reset(new CommandParser(NULL, 0, 0, 0, 0, | 87 parser_.reset(new CommandParser(NULL, 0, 0, 0, 0, |
| 87 decoder_.get())); | 88 decoder_.get())); |
| 88 } | 89 } |
| 89 | 90 |
| 90 // Initialize the decoder with either the view or pbuffer GLContext. | 91 // Initialize the decoder with either the view or pbuffer GLContext. |
| 91 if (!decoder_->Initialize(context, | 92 if (!decoder_->Initialize(context, |
| 92 size, | 93 size, |
| 94 disallowed, | |
| 93 allowed_extensions, | 95 allowed_extensions, |
| 94 attribs, | 96 attribs, |
| 95 parent_decoder, | 97 parent_decoder, |
| 96 parent_texture_id)) { | 98 parent_texture_id)) { |
| 97 LOG(ERROR) << "GPUProcessor::InitializeCommon failed because decoder " | 99 LOG(ERROR) << "GPUProcessor::InitializeCommon failed because decoder " |
| 98 << "failed to initialize."; | 100 << "failed to initialize."; |
| 99 Destroy(); | 101 Destroy(); |
| 100 return false; | 102 return false; |
| 101 } | 103 } |
| 102 | 104 |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 231 | 233 |
| 232 void GPUProcessor::SetSwapBuffersCallback( | 234 void GPUProcessor::SetSwapBuffersCallback( |
| 233 Callback0::Type* callback) { | 235 Callback0::Type* callback) { |
| 234 wrapped_swap_buffers_callback_.reset(callback); | 236 wrapped_swap_buffers_callback_.reset(callback); |
| 235 decoder_->SetSwapBuffersCallback( | 237 decoder_->SetSwapBuffersCallback( |
| 236 NewCallback(this, | 238 NewCallback(this, |
| 237 &GPUProcessor::WillSwapBuffers)); | 239 &GPUProcessor::WillSwapBuffers)); |
| 238 } | 240 } |
| 239 | 241 |
| 240 } // namespace gpu | 242 } // namespace gpu |
| OLD | NEW |