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 2701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2712 | 2712 |
2713 bool GLES2DecoderImpl::MakeCurrent() { | 2713 bool GLES2DecoderImpl::MakeCurrent() { |
2714 if (!context_.get() || !context_->MakeCurrent(surface_.get())) | 2714 if (!context_.get() || !context_->MakeCurrent(surface_.get())) |
2715 return false; | 2715 return false; |
2716 | 2716 |
2717 if (WasContextLost()) { | 2717 if (WasContextLost()) { |
2718 LOG(ERROR) << " GLES2DecoderImpl: Context lost during MakeCurrent."; | 2718 LOG(ERROR) << " GLES2DecoderImpl: Context lost during MakeCurrent."; |
2719 return false; | 2719 return false; |
2720 } | 2720 } |
2721 | 2721 |
| 2722 if (query_manager_.get()) |
| 2723 query_manager_->ProcessPendingTransferQueries(); |
| 2724 |
2722 // TODO(epenner): Is there a better place to do this? Transfers | 2725 // TODO(epenner): Is there a better place to do this? Transfers |
2723 // can complete any time we yield the main thread. So we *must* | 2726 // can complete any time we yield the main thread. So we *must* |
2724 // process transfers after any such yield, before resuming. | 2727 // process transfers after any such yield, before resuming. |
2725 bool frame_buffer_dirty = false; | 2728 bool frame_buffer_dirty = false; |
2726 bool texture_dirty = false; | 2729 bool texture_dirty = false; |
2727 texture_manager()->BindFinishedAsyncPixelTransfers( | 2730 texture_manager()->BindFinishedAsyncPixelTransfers( |
2728 &texture_dirty, &frame_buffer_dirty); | 2731 &texture_dirty, &frame_buffer_dirty); |
2729 // Texture unit zero might be stomped. | 2732 // Texture unit zero might be stomped. |
2730 if (texture_dirty) | 2733 if (texture_dirty) |
2731 RestoreCurrentTexture2DBindings(); | 2734 RestoreCurrentTexture2DBindings(); |
(...skipping 6377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9109 if (state_.current_query->target() != target) { | 9112 if (state_.current_query->target() != target) { |
9110 SetGLError(GL_INVALID_OPERATION, | 9113 SetGLError(GL_INVALID_OPERATION, |
9111 "glEndQueryEXT", "target does not match active query"); | 9114 "glEndQueryEXT", "target does not match active query"); |
9112 return error::kNoError; | 9115 return error::kNoError; |
9113 } | 9116 } |
9114 | 9117 |
9115 if (!query_manager_->EndQuery(state_.current_query, submit_count)) { | 9118 if (!query_manager_->EndQuery(state_.current_query, submit_count)) { |
9116 return error::kOutOfBounds; | 9119 return error::kOutOfBounds; |
9117 } | 9120 } |
9118 | 9121 |
| 9122 query_manager_->ProcessPendingTransferQueries(); |
| 9123 |
9119 state_.current_query = NULL; | 9124 state_.current_query = NULL; |
9120 return error::kNoError; | 9125 return error::kNoError; |
9121 } | 9126 } |
9122 | 9127 |
9123 bool GLES2DecoderImpl::GenVertexArraysOESHelper( | 9128 bool GLES2DecoderImpl::GenVertexArraysOESHelper( |
9124 GLsizei n, const GLuint* client_ids) { | 9129 GLsizei n, const GLuint* client_ids) { |
9125 for (GLsizei ii = 0; ii < n; ++ii) { | 9130 for (GLsizei ii = 0; ii < n; ++ii) { |
9126 if (GetVertexAttribManager(client_ids[ii])) { | 9131 if (GetVertexAttribManager(client_ids[ii])) { |
9127 return false; | 9132 return false; |
9128 } | 9133 } |
(...skipping 948 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10077 return error::kNoError; | 10082 return error::kNoError; |
10078 } | 10083 } |
10079 | 10084 |
10080 // Include the auto-generated part of this file. We split this because it means | 10085 // Include the auto-generated part of this file. We split this because it means |
10081 // we can easily edit the non-auto generated parts right here in this file | 10086 // we can easily edit the non-auto generated parts right here in this file |
10082 // instead of having to edit some template or the code generator. | 10087 // instead of having to edit some template or the code generator. |
10083 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 10088 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
10084 | 10089 |
10085 } // namespace gles2 | 10090 } // namespace gles2 |
10086 } // namespace gpu | 10091 } // namespace gpu |
OLD | NEW |