Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(367)

Side by Side Diff: gpu/command_buffer/service/gles2_cmd_decoder.cc

Issue 12213073: Re-land: Mark async texture uploads as completed from the upload thread. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix shutdown issue Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 6377 matching lines...) Expand 10 before | Expand all | Expand 10 after
9115 if (state_.current_query->target() != target) { 9118 if (state_.current_query->target() != target) {
9116 SetGLError(GL_INVALID_OPERATION, 9119 SetGLError(GL_INVALID_OPERATION,
9117 "glEndQueryEXT", "target does not match active query"); 9120 "glEndQueryEXT", "target does not match active query");
9118 return error::kNoError; 9121 return error::kNoError;
9119 } 9122 }
9120 9123
9121 if (!query_manager_->EndQuery(state_.current_query, submit_count)) { 9124 if (!query_manager_->EndQuery(state_.current_query, submit_count)) {
9122 return error::kOutOfBounds; 9125 return error::kOutOfBounds;
9123 } 9126 }
9124 9127
9128 query_manager_->ProcessPendingTransferQueries();
9129
9125 state_.current_query = NULL; 9130 state_.current_query = NULL;
9126 return error::kNoError; 9131 return error::kNoError;
9127 } 9132 }
9128 9133
9129 bool GLES2DecoderImpl::GenVertexArraysOESHelper( 9134 bool GLES2DecoderImpl::GenVertexArraysOESHelper(
9130 GLsizei n, const GLuint* client_ids) { 9135 GLsizei n, const GLuint* client_ids) {
9131 for (GLsizei ii = 0; ii < n; ++ii) { 9136 for (GLsizei ii = 0; ii < n; ++ii) {
9132 if (GetVertexAttribManager(client_ids[ii])) { 9137 if (GetVertexAttribManager(client_ids[ii])) {
9133 return false; 9138 return false;
9134 } 9139 }
(...skipping 948 matching lines...) Expand 10 before | Expand all | Expand 10 after
10083 return error::kNoError; 10088 return error::kNoError;
10084 } 10089 }
10085 10090
10086 // Include the auto-generated part of this file. We split this because it means 10091 // Include the auto-generated part of this file. We split this because it means
10087 // we can easily edit the non-auto generated parts right here in this file 10092 // we can easily edit the non-auto generated parts right here in this file
10088 // instead of having to edit some template or the code generator. 10093 // instead of having to edit some template or the code generator.
10089 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" 10094 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h"
10090 10095
10091 } // namespace gles2 10096 } // namespace gles2
10092 } // namespace gpu 10097 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698