OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/gles2_cmd_decoder.h" | 5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" |
6 | 6 |
7 #include <stdio.h> | 7 #include <stdio.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <list> | 10 #include <list> |
(...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
636 | 636 |
637 virtual void SetResizeCallback( | 637 virtual void SetResizeCallback( |
638 const base::Callback<void(gfx::Size)>& callback) OVERRIDE; | 638 const base::Callback<void(gfx::Size)>& callback) OVERRIDE; |
639 | 639 |
640 virtual void SetMsgCallback(const MsgCallback& callback) OVERRIDE; | 640 virtual void SetMsgCallback(const MsgCallback& callback) OVERRIDE; |
641 virtual void SetShaderCacheCallback( | 641 virtual void SetShaderCacheCallback( |
642 const ShaderCacheCallback& callback) OVERRIDE; | 642 const ShaderCacheCallback& callback) OVERRIDE; |
643 virtual void SetWaitSyncPointCallback( | 643 virtual void SetWaitSyncPointCallback( |
644 const WaitSyncPointCallback& callback) OVERRIDE; | 644 const WaitSyncPointCallback& callback) OVERRIDE; |
645 | 645 |
| 646 virtual void SetEncodeBackbufferCallback( |
| 647 const EncodeBackbufferCallback& callback) OVERRIDE; |
| 648 |
646 virtual void SetStreamTextureManager(StreamTextureManager* manager) OVERRIDE; | 649 virtual void SetStreamTextureManager(StreamTextureManager* manager) OVERRIDE; |
647 | 650 |
648 virtual gfx::AsyncPixelTransferDelegate* | 651 virtual gfx::AsyncPixelTransferDelegate* |
649 GetAsyncPixelTransferDelegate() OVERRIDE; | 652 GetAsyncPixelTransferDelegate() OVERRIDE; |
650 virtual void SetAsyncPixelTransferDelegate( | 653 virtual void SetAsyncPixelTransferDelegate( |
651 gfx::AsyncPixelTransferDelegate* delegate) OVERRIDE; | 654 gfx::AsyncPixelTransferDelegate* delegate) OVERRIDE; |
652 void ProcessFinishedAsyncTransfers(); | 655 void ProcessFinishedAsyncTransfers(); |
653 | 656 |
654 virtual bool GetServiceTextureId(uint32 client_texture_id, | 657 virtual bool GetServiceTextureId(uint32 client_texture_id, |
655 uint32* service_texture_id) OVERRIDE; | 658 uint32* service_texture_id) OVERRIDE; |
(...skipping 1069 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1725 | 1728 |
1726 scoped_ptr<VertexArrayManager> vertex_array_manager_; | 1729 scoped_ptr<VertexArrayManager> vertex_array_manager_; |
1727 | 1730 |
1728 base::Callback<void(gfx::Size)> resize_callback_; | 1731 base::Callback<void(gfx::Size)> resize_callback_; |
1729 | 1732 |
1730 MsgCallback msg_callback_; | 1733 MsgCallback msg_callback_; |
1731 WaitSyncPointCallback wait_sync_point_callback_; | 1734 WaitSyncPointCallback wait_sync_point_callback_; |
1732 | 1735 |
1733 ShaderCacheCallback shader_cache_callback_; | 1736 ShaderCacheCallback shader_cache_callback_; |
1734 | 1737 |
| 1738 EncodeBackbufferCallback encode_backbuffer_callback_; |
| 1739 |
1735 StreamTextureManager* stream_texture_manager_; | 1740 StreamTextureManager* stream_texture_manager_; |
1736 scoped_ptr<gfx::AsyncPixelTransferDelegate> async_pixel_transfer_delegate_; | 1741 scoped_ptr<gfx::AsyncPixelTransferDelegate> async_pixel_transfer_delegate_; |
1737 | 1742 |
1738 // The format of the back buffer_ | 1743 // The format of the back buffer_ |
1739 GLenum back_buffer_color_format_; | 1744 GLenum back_buffer_color_format_; |
1740 bool back_buffer_has_depth_; | 1745 bool back_buffer_has_depth_; |
1741 bool back_buffer_has_stencil_; | 1746 bool back_buffer_has_stencil_; |
1742 | 1747 |
1743 // Backbuffer attachments that are currently undefined. | 1748 // Backbuffer attachments that are currently undefined. |
1744 uint32 backbuffer_needs_clear_bits_; | 1749 uint32 backbuffer_needs_clear_bits_; |
(...skipping 1368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3113 void GLES2DecoderImpl::SetShaderCacheCallback( | 3118 void GLES2DecoderImpl::SetShaderCacheCallback( |
3114 const ShaderCacheCallback& callback) { | 3119 const ShaderCacheCallback& callback) { |
3115 shader_cache_callback_ = callback; | 3120 shader_cache_callback_ = callback; |
3116 } | 3121 } |
3117 | 3122 |
3118 void GLES2DecoderImpl::SetWaitSyncPointCallback( | 3123 void GLES2DecoderImpl::SetWaitSyncPointCallback( |
3119 const WaitSyncPointCallback& callback) { | 3124 const WaitSyncPointCallback& callback) { |
3120 wait_sync_point_callback_ = callback; | 3125 wait_sync_point_callback_ = callback; |
3121 } | 3126 } |
3122 | 3127 |
| 3128 void GLES2DecoderImpl::SetEncodeBackbufferCallback( |
| 3129 const EncodeBackbufferCallback& callback) { |
| 3130 encode_backbuffer_callback_ = callback; |
| 3131 } |
| 3132 |
3123 void GLES2DecoderImpl::SetStreamTextureManager(StreamTextureManager* manager) { | 3133 void GLES2DecoderImpl::SetStreamTextureManager(StreamTextureManager* manager) { |
3124 stream_texture_manager_ = manager; | 3134 stream_texture_manager_ = manager; |
3125 } | 3135 } |
3126 | 3136 |
3127 gfx::AsyncPixelTransferDelegate* | 3137 gfx::AsyncPixelTransferDelegate* |
3128 GLES2DecoderImpl::GetAsyncPixelTransferDelegate() { | 3138 GLES2DecoderImpl::GetAsyncPixelTransferDelegate() { |
3129 return async_pixel_transfer_delegate_.get(); | 3139 return async_pixel_transfer_delegate_.get(); |
3130 } | 3140 } |
3131 | 3141 |
3132 void GLES2DecoderImpl::SetAsyncPixelTransferDelegate( | 3142 void GLES2DecoderImpl::SetAsyncPixelTransferDelegate( |
(...skipping 6114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9247 | 9257 |
9248 error::Error GLES2DecoderImpl::HandleWaitSyncPointCHROMIUM( | 9258 error::Error GLES2DecoderImpl::HandleWaitSyncPointCHROMIUM( |
9249 uint32 immediate_data_size, const cmds::WaitSyncPointCHROMIUM& c) { | 9259 uint32 immediate_data_size, const cmds::WaitSyncPointCHROMIUM& c) { |
9250 if (wait_sync_point_callback_.is_null()) | 9260 if (wait_sync_point_callback_.is_null()) |
9251 return error::kNoError; | 9261 return error::kNoError; |
9252 | 9262 |
9253 return wait_sync_point_callback_.Run(c.sync_point) ? | 9263 return wait_sync_point_callback_.Run(c.sync_point) ? |
9254 error::kNoError : error::kDeferCommandUntilLater; | 9264 error::kNoError : error::kDeferCommandUntilLater; |
9255 } | 9265 } |
9256 | 9266 |
| 9267 error::Error GLES2DecoderImpl::HandleEncodeBackbufferCHROMIUM( |
| 9268 uint32 immediate_data_size, const cmds::EncodeBackbufferCHROMIUM& c) { |
| 9269 if (!encode_backbuffer_callback_.is_null()) |
| 9270 encode_backbuffer_callback_.Run(); |
| 9271 |
| 9272 return error::kNoError; |
| 9273 } |
| 9274 |
9257 bool GLES2DecoderImpl::GenQueriesEXTHelper( | 9275 bool GLES2DecoderImpl::GenQueriesEXTHelper( |
9258 GLsizei n, const GLuint* client_ids) { | 9276 GLsizei n, const GLuint* client_ids) { |
9259 for (GLsizei ii = 0; ii < n; ++ii) { | 9277 for (GLsizei ii = 0; ii < n; ++ii) { |
9260 if (query_manager_->GetQuery(client_ids[ii])) { | 9278 if (query_manager_->GetQuery(client_ids[ii])) { |
9261 return false; | 9279 return false; |
9262 } | 9280 } |
9263 } | 9281 } |
9264 // NOTE: We don't generate Query objects here. Only in BeginQueryEXT | 9282 // NOTE: We don't generate Query objects here. Only in BeginQueryEXT |
9265 return true; | 9283 return true; |
9266 } | 9284 } |
(...skipping 1186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10453 return error::kNoError; | 10471 return error::kNoError; |
10454 } | 10472 } |
10455 | 10473 |
10456 // Include the auto-generated part of this file. We split this because it means | 10474 // Include the auto-generated part of this file. We split this because it means |
10457 // we can easily edit the non-auto generated parts right here in this file | 10475 // we can easily edit the non-auto generated parts right here in this file |
10458 // instead of having to edit some template or the code generator. | 10476 // instead of having to edit some template or the code generator. |
10459 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 10477 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
10460 | 10478 |
10461 } // namespace gles2 | 10479 } // namespace gles2 |
10462 } // namespace gpu | 10480 } // namespace gpu |
OLD | NEW |