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