| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "mojo/gles2/gles2_context.h" | 5 #include "mojo/gles2/gles2_context.h" |
| 6 | 6 |
| 7 #include "gpu/command_buffer/client/gles2_cmd_helper.h" | 7 #include "gpu/command_buffer/client/gles2_cmd_helper.h" |
| 8 #include "gpu/command_buffer/client/gles2_implementation.h" | 8 #include "gpu/command_buffer/client/gles2_implementation.h" |
| 9 #include "gpu/command_buffer/client/transfer_buffer.h" | 9 #include "gpu/command_buffer/client/transfer_buffer.h" |
| 10 #include "mojo/public/gles2/gles2.h" | 10 #include "mojo/public/gles2/gles2.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 gles2_helper_.reset(new gpu::gles2::GLES2CmdHelper(&command_buffer_)); | 38 gles2_helper_.reset(new gpu::gles2::GLES2CmdHelper(&command_buffer_)); |
| 39 if (!gles2_helper_->Initialize(kDefaultCommandBufferSize)) | 39 if (!gles2_helper_->Initialize(kDefaultCommandBufferSize)) |
| 40 return false; | 40 return false; |
| 41 gles2_helper_->SetAutomaticFlushes(false); | 41 gles2_helper_->SetAutomaticFlushes(false); |
| 42 transfer_buffer_.reset(new gpu::TransferBuffer(gles2_helper_.get())); | 42 transfer_buffer_.reset(new gpu::TransferBuffer(gles2_helper_.get())); |
| 43 implementation_.reset( | 43 implementation_.reset( |
| 44 new gpu::gles2::GLES2Implementation(gles2_helper_.get(), | 44 new gpu::gles2::GLES2Implementation(gles2_helper_.get(), |
| 45 NULL, | 45 NULL, |
| 46 transfer_buffer_.get(), | 46 transfer_buffer_.get(), |
| 47 true, | 47 true, |
| 48 &command_buffer_)); | 48 &command_buffer_, |
| 49 // TODO(piman) |
| 50 gpu::Capabilities())); |
| 49 return implementation_->Initialize(kDefaultStartTransferBufferSize, | 51 return implementation_->Initialize(kDefaultStartTransferBufferSize, |
| 50 kDefaultMinTransferBufferSize, | 52 kDefaultMinTransferBufferSize, |
| 51 kDefaultMaxTransferBufferSize, | 53 kDefaultMaxTransferBufferSize, |
| 52 gpu::gles2::GLES2Implementation::kNoLimit); | 54 gpu::gles2::GLES2Implementation::kNoLimit); |
| 53 } | 55 } |
| 54 | 56 |
| 55 void GLES2Context::RequestAnimationFrames() { | 57 void GLES2Context::RequestAnimationFrames() { |
| 56 command_buffer_.RequestAnimationFrames(); | 58 command_buffer_.RequestAnimationFrames(); |
| 57 } | 59 } |
| 58 | 60 |
| 59 void GLES2Context::CancelAnimationFrames() { | 61 void GLES2Context::CancelAnimationFrames() { |
| 60 command_buffer_.CancelAnimationFrames(); | 62 command_buffer_.CancelAnimationFrames(); |
| 61 } | 63 } |
| 62 | 64 |
| 63 void GLES2Context::ContextLost() { lost_callback_(closure_); } | 65 void GLES2Context::ContextLost() { lost_callback_(closure_); } |
| 64 | 66 |
| 65 void GLES2Context::DrawAnimationFrame() { animation_callback_(closure_); } | 67 void GLES2Context::DrawAnimationFrame() { animation_callback_(closure_); } |
| 66 | 68 |
| 67 } // namespace gles2 | 69 } // namespace gles2 |
| 68 } // namespace mojo | 70 } // namespace mojo |
| OLD | NEW |