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 540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
551 virtual void SetGLError(GLenum error, | 551 virtual void SetGLError(GLenum error, |
552 const char* function_name, | 552 const char* function_name, |
553 const char* msg); | 553 const char* msg); |
554 virtual void SetGLErrorInvalidEnum(const char* function_name, | 554 virtual void SetGLErrorInvalidEnum(const char* function_name, |
555 GLenum value, | 555 GLenum value, |
556 const char* label); | 556 const char* label); |
557 virtual void SetResizeCallback( | 557 virtual void SetResizeCallback( |
558 const base::Callback<void(gfx::Size)>& callback) OVERRIDE; | 558 const base::Callback<void(gfx::Size)>& callback) OVERRIDE; |
559 | 559 |
560 virtual void SetMsgCallback(const MsgCallback& callback) OVERRIDE; | 560 virtual void SetMsgCallback(const MsgCallback& callback) OVERRIDE; |
| 561 virtual void SetWaitSyncPointCallback( |
| 562 const WaitSyncPointCallback& callback) OVERRIDE; |
561 | 563 |
562 virtual void SetStreamTextureManager(StreamTextureManager* manager) OVERRIDE; | 564 virtual void SetStreamTextureManager(StreamTextureManager* manager) OVERRIDE; |
563 | 565 |
564 virtual gfx::AsyncPixelTransferDelegate* | 566 virtual gfx::AsyncPixelTransferDelegate* |
565 GetAsyncPixelTransferDelegate() OVERRIDE; | 567 GetAsyncPixelTransferDelegate() OVERRIDE; |
566 virtual void SetAsyncPixelTransferDelegate( | 568 virtual void SetAsyncPixelTransferDelegate( |
567 gfx::AsyncPixelTransferDelegate* delegate) OVERRIDE; | 569 gfx::AsyncPixelTransferDelegate* delegate) OVERRIDE; |
568 | 570 |
569 virtual bool GetServiceTextureId(uint32 client_texture_id, | 571 virtual bool GetServiceTextureId(uint32 client_texture_id, |
570 uint32* service_texture_id) OVERRIDE; | 572 uint32* service_texture_id) OVERRIDE; |
(...skipping 1053 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1624 scoped_ptr<Texture> offscreen_resolved_color_texture_; | 1626 scoped_ptr<Texture> offscreen_resolved_color_texture_; |
1625 GLenum offscreen_saved_color_format_; | 1627 GLenum offscreen_saved_color_format_; |
1626 | 1628 |
1627 scoped_ptr<QueryManager> query_manager_; | 1629 scoped_ptr<QueryManager> query_manager_; |
1628 | 1630 |
1629 scoped_ptr<VertexArrayManager> vertex_array_manager_; | 1631 scoped_ptr<VertexArrayManager> vertex_array_manager_; |
1630 | 1632 |
1631 base::Callback<void(gfx::Size)> resize_callback_; | 1633 base::Callback<void(gfx::Size)> resize_callback_; |
1632 | 1634 |
1633 MsgCallback msg_callback_; | 1635 MsgCallback msg_callback_; |
| 1636 WaitSyncPointCallback wait_sync_point_callback_; |
1634 | 1637 |
1635 StreamTextureManager* stream_texture_manager_; | 1638 StreamTextureManager* stream_texture_manager_; |
1636 scoped_ptr<gfx::AsyncPixelTransferDelegate> async_pixel_transfer_delegate_; | 1639 scoped_ptr<gfx::AsyncPixelTransferDelegate> async_pixel_transfer_delegate_; |
1637 | 1640 |
1638 // The format of the back buffer_ | 1641 // The format of the back buffer_ |
1639 GLenum back_buffer_color_format_; | 1642 GLenum back_buffer_color_format_; |
1640 bool back_buffer_has_depth_; | 1643 bool back_buffer_has_depth_; |
1641 bool back_buffer_has_stencil_; | 1644 bool back_buffer_has_stencil_; |
1642 | 1645 |
1643 // Backbuffer attachments that are currently undefined. | 1646 // Backbuffer attachments that are currently undefined. |
(...skipping 1327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2971 | 2974 |
2972 void GLES2DecoderImpl::SetResizeCallback( | 2975 void GLES2DecoderImpl::SetResizeCallback( |
2973 const base::Callback<void(gfx::Size)>& callback) { | 2976 const base::Callback<void(gfx::Size)>& callback) { |
2974 resize_callback_ = callback; | 2977 resize_callback_ = callback; |
2975 } | 2978 } |
2976 | 2979 |
2977 void GLES2DecoderImpl::SetMsgCallback(const MsgCallback& callback) { | 2980 void GLES2DecoderImpl::SetMsgCallback(const MsgCallback& callback) { |
2978 msg_callback_ = callback; | 2981 msg_callback_ = callback; |
2979 } | 2982 } |
2980 | 2983 |
| 2984 void GLES2DecoderImpl::SetWaitSyncPointCallback( |
| 2985 const WaitSyncPointCallback& callback) { |
| 2986 wait_sync_point_callback_ = callback; |
| 2987 } |
| 2988 |
2981 void GLES2DecoderImpl::SetStreamTextureManager(StreamTextureManager* manager) { | 2989 void GLES2DecoderImpl::SetStreamTextureManager(StreamTextureManager* manager) { |
2982 stream_texture_manager_ = manager; | 2990 stream_texture_manager_ = manager; |
2983 } | 2991 } |
2984 | 2992 |
2985 gfx::AsyncPixelTransferDelegate* | 2993 gfx::AsyncPixelTransferDelegate* |
2986 GLES2DecoderImpl::GetAsyncPixelTransferDelegate() { | 2994 GLES2DecoderImpl::GetAsyncPixelTransferDelegate() { |
2987 return async_pixel_transfer_delegate_.get(); | 2995 return async_pixel_transfer_delegate_.get(); |
2988 } | 2996 } |
2989 | 2997 |
2990 void GLES2DecoderImpl::SetAsyncPixelTransferDelegate( | 2998 void GLES2DecoderImpl::SetAsyncPixelTransferDelegate( |
(...skipping 6010 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9001 } | 9009 } |
9002 if (!validators_->reset_status.IsValid(other)) { | 9010 if (!validators_->reset_status.IsValid(other)) { |
9003 SetGLErrorInvalidEnum("glLoseContextCHROMIUM", other, "other"); | 9011 SetGLErrorInvalidEnum("glLoseContextCHROMIUM", other, "other"); |
9004 } | 9012 } |
9005 group_->LoseContexts(other); | 9013 group_->LoseContexts(other); |
9006 reset_status_ = current; | 9014 reset_status_ = current; |
9007 current_decoder_error_ = error::kLostContext; | 9015 current_decoder_error_ = error::kLostContext; |
9008 return error::kLostContext; | 9016 return error::kLostContext; |
9009 } | 9017 } |
9010 | 9018 |
| 9019 error::Error GLES2DecoderImpl::HandleWaitSyncPointCHROMIUM( |
| 9020 uint32 immediate_data_size, const gles2::WaitSyncPointCHROMIUM& c) { |
| 9021 if (wait_sync_point_callback_.is_null()) |
| 9022 return error::kNoError; |
| 9023 |
| 9024 return wait_sync_point_callback_.Run(c.sync_point) ? |
| 9025 error::kNoError : error::kDeferCommandUntilLater; |
| 9026 } |
| 9027 |
9011 bool GLES2DecoderImpl::GenQueriesEXTHelper( | 9028 bool GLES2DecoderImpl::GenQueriesEXTHelper( |
9012 GLsizei n, const GLuint* client_ids) { | 9029 GLsizei n, const GLuint* client_ids) { |
9013 for (GLsizei ii = 0; ii < n; ++ii) { | 9030 for (GLsizei ii = 0; ii < n; ++ii) { |
9014 if (query_manager_->GetQuery(client_ids[ii])) { | 9031 if (query_manager_->GetQuery(client_ids[ii])) { |
9015 return false; | 9032 return false; |
9016 } | 9033 } |
9017 } | 9034 } |
9018 // NOTE: We don't generate Query objects here. Only in BeginQueryEXT | 9035 // NOTE: We don't generate Query objects here. Only in BeginQueryEXT |
9019 return true; | 9036 return true; |
9020 } | 9037 } |
(...skipping 1075 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10096 return error::kNoError; | 10113 return error::kNoError; |
10097 } | 10114 } |
10098 | 10115 |
10099 // Include the auto-generated part of this file. We split this because it means | 10116 // Include the auto-generated part of this file. We split this because it means |
10100 // we can easily edit the non-auto generated parts right here in this file | 10117 // we can easily edit the non-auto generated parts right here in this file |
10101 // instead of having to edit some template or the code generator. | 10118 // instead of having to edit some template or the code generator. |
10102 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 10119 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
10103 | 10120 |
10104 } // namespace gles2 | 10121 } // namespace gles2 |
10105 } // namespace gpu | 10122 } // namespace gpu |
OLD | NEW |