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

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

Issue 14188053: gpu: Change Produce/ConsumeTexture to allow texture sharing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 6 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/gl_context_virtual.h" 5 #include "gpu/command_buffer/service/gl_context_virtual.h"
6 6
7 #include "gpu/command_buffer/service/gl_state_restorer_impl.h" 7 #include "gpu/command_buffer/service/gl_state_restorer_impl.h"
8 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" 8 #include "gpu/command_buffer/service/gles2_cmd_decoder.h"
9 #include "ui/gl/gl_surface.h" 9 #include "ui/gl/gl_surface.h"
10 10
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 } 65 }
66 66
67 void GLContextVirtual::ReleaseCurrent(gfx::GLSurface* surface) { 67 void GLContextVirtual::ReleaseCurrent(gfx::GLSurface* surface) {
68 if (IsCurrent(surface)) 68 if (IsCurrent(surface))
69 shared_context_->ReleaseCurrent(surface); 69 shared_context_->ReleaseCurrent(surface);
70 } 70 }
71 71
72 bool GLContextVirtual::IsCurrent(gfx::GLSurface* surface) { 72 bool GLContextVirtual::IsCurrent(gfx::GLSurface* surface) {
73 // If it's a real surface it needs to be current. 73 // If it's a real surface it needs to be current.
74 if (surface && 74 if (surface &&
75 !surface->GetBackingFrameBufferObject() && 75 !surface->IsOffscreen() &&
76 !surface->IsOffscreen()) 76 !surface->GetBackingFrameBufferObject())
77 return shared_context_->IsCurrent(surface); 77 return shared_context_->IsCurrent(surface);
78 78
79 // Otherwise, only insure the context itself is current. 79 // Otherwise, only insure the context itself is current.
80 return shared_context_->IsCurrent(NULL); 80 return shared_context_->IsCurrent(NULL);
81 } 81 }
82 82
83 void* GLContextVirtual::GetHandle() { 83 void* GLContextVirtual::GetHandle() {
84 return shared_context_->GetHandle(); 84 return shared_context_->GetHandle();
85 } 85 }
86 86
(...skipping 22 matching lines...) Expand all
109 109
110 void GLContextVirtual::SetUnbindFboOnMakeCurrent() { 110 void GLContextVirtual::SetUnbindFboOnMakeCurrent() {
111 shared_context_->SetUnbindFboOnMakeCurrent(); 111 shared_context_->SetUnbindFboOnMakeCurrent();
112 } 112 }
113 113
114 GLContextVirtual::~GLContextVirtual() { 114 GLContextVirtual::~GLContextVirtual() {
115 Destroy(); 115 Destroy();
116 } 116 }
117 117
118 } // namespace gpu 118 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/framebuffer_manager.cc ('k') | gpu/command_buffer/service/gles2_cmd_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698