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 2707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2718 | 2718 |
2719 bool GLES2DecoderImpl::MakeCurrent() { | 2719 bool GLES2DecoderImpl::MakeCurrent() { |
2720 if (!context_.get() || !context_->MakeCurrent(surface_.get())) | 2720 if (!context_.get() || !context_->MakeCurrent(surface_.get())) |
2721 return false; | 2721 return false; |
2722 | 2722 |
2723 if (WasContextLost()) { | 2723 if (WasContextLost()) { |
2724 LOG(ERROR) << " GLES2DecoderImpl: Context lost during MakeCurrent."; | 2724 LOG(ERROR) << " GLES2DecoderImpl: Context lost during MakeCurrent."; |
2725 return false; | 2725 return false; |
2726 } | 2726 } |
2727 | 2727 |
| 2728 if (engine() && query_manager_.get()) |
| 2729 query_manager_->ProcessPendingTransferQueries(); |
| 2730 |
2728 // TODO(epenner): Is there a better place to do this? Transfers | 2731 // TODO(epenner): Is there a better place to do this? Transfers |
2729 // can complete any time we yield the main thread. So we *must* | 2732 // can complete any time we yield the main thread. So we *must* |
2730 // process transfers after any such yield, before resuming. | 2733 // process transfers after any such yield, before resuming. |
2731 bool frame_buffer_dirty = false; | 2734 bool frame_buffer_dirty = false; |
2732 bool texture_dirty = false; | 2735 bool texture_dirty = false; |
2733 texture_manager()->BindFinishedAsyncPixelTransfers( | 2736 texture_manager()->BindFinishedAsyncPixelTransfers( |
2734 &texture_dirty, &frame_buffer_dirty); | 2737 &texture_dirty, &frame_buffer_dirty); |
2735 // Texture unit zero might be stomped. | 2738 // Texture unit zero might be stomped. |
2736 if (texture_dirty) | 2739 if (texture_dirty) |
2737 RestoreCurrentTexture2DBindings(); | 2740 RestoreCurrentTexture2DBindings(); |
(...skipping 6381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9119 if (state_.current_query->target() != target) { | 9122 if (state_.current_query->target() != target) { |
9120 SetGLError(GL_INVALID_OPERATION, | 9123 SetGLError(GL_INVALID_OPERATION, |
9121 "glEndQueryEXT", "target does not match active query"); | 9124 "glEndQueryEXT", "target does not match active query"); |
9122 return error::kNoError; | 9125 return error::kNoError; |
9123 } | 9126 } |
9124 | 9127 |
9125 if (!query_manager_->EndQuery(state_.current_query, submit_count)) { | 9128 if (!query_manager_->EndQuery(state_.current_query, submit_count)) { |
9126 return error::kOutOfBounds; | 9129 return error::kOutOfBounds; |
9127 } | 9130 } |
9128 | 9131 |
| 9132 query_manager_->ProcessPendingTransferQueries(); |
| 9133 |
9129 state_.current_query = NULL; | 9134 state_.current_query = NULL; |
9130 return error::kNoError; | 9135 return error::kNoError; |
9131 } | 9136 } |
9132 | 9137 |
9133 bool GLES2DecoderImpl::GenVertexArraysOESHelper( | 9138 bool GLES2DecoderImpl::GenVertexArraysOESHelper( |
9134 GLsizei n, const GLuint* client_ids) { | 9139 GLsizei n, const GLuint* client_ids) { |
9135 for (GLsizei ii = 0; ii < n; ++ii) { | 9140 for (GLsizei ii = 0; ii < n; ++ii) { |
9136 if (GetVertexAttribManager(client_ids[ii])) { | 9141 if (GetVertexAttribManager(client_ids[ii])) { |
9137 return false; | 9142 return false; |
9138 } | 9143 } |
(...skipping 948 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10087 return error::kNoError; | 10092 return error::kNoError; |
10088 } | 10093 } |
10089 | 10094 |
10090 // Include the auto-generated part of this file. We split this because it means | 10095 // Include the auto-generated part of this file. We split this because it means |
10091 // we can easily edit the non-auto generated parts right here in this file | 10096 // we can easily edit the non-auto generated parts right here in this file |
10092 // instead of having to edit some template or the code generator. | 10097 // instead of having to edit some template or the code generator. |
10093 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 10098 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
10094 | 10099 |
10095 } // namespace gles2 | 10100 } // namespace gles2 |
10096 } // namespace gpu | 10101 } // namespace gpu |
OLD | NEW |