| 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/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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |