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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 return true; | 66 return true; |
67 | 67 |
68 gfx::GLSurface* current_surface = gfx::GLSurface::GetCurrent(); | 68 gfx::GLSurface* current_surface = gfx::GLSurface::GetCurrent(); |
69 return surface->GetBackingFrameBufferObject() || | 69 return surface->GetBackingFrameBufferObject() || |
70 surface->IsOffscreen() || | 70 surface->IsOffscreen() || |
71 (current_surface && | 71 (current_surface && |
72 current_surface->GetHandle() == surface->GetHandle()); | 72 current_surface->GetHandle() == surface->GetHandle()); |
73 } | 73 } |
74 | 74 |
75 void* GLContextVirtual::GetHandle() { | 75 void* GLContextVirtual::GetHandle() { |
76 return NULL; | 76 return shared_context_->GetHandle(); |
77 } | 77 } |
78 | 78 |
79 gfx::GLStateRestorer* GLContextVirtual::GetGLStateRestorer() { | 79 gfx::GLStateRestorer* GLContextVirtual::GetGLStateRestorer() { |
80 return state_restorer_.get(); | 80 return state_restorer_.get(); |
81 } | 81 } |
82 | 82 |
83 void GLContextVirtual::SetSwapInterval(int interval) { | 83 void GLContextVirtual::SetSwapInterval(int interval) { |
84 shared_context_->SetSwapInterval(interval); | 84 shared_context_->SetSwapInterval(interval); |
85 } | 85 } |
86 | 86 |
(...skipping 14 matching lines...) Expand all Loading... |
101 | 101 |
102 bool GLContextVirtual::WasAllocatedUsingRobustnessExtension() { | 102 bool GLContextVirtual::WasAllocatedUsingRobustnessExtension() { |
103 return shared_context_->WasAllocatedUsingRobustnessExtension(); | 103 return shared_context_->WasAllocatedUsingRobustnessExtension(); |
104 } | 104 } |
105 | 105 |
106 GLContextVirtual::~GLContextVirtual() { | 106 GLContextVirtual::~GLContextVirtual() { |
107 Destroy(); | 107 Destroy(); |
108 } | 108 } |
109 | 109 |
110 } // namespace gpu | 110 } // namespace gpu |
OLD | NEW |