| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "app/gfx/gl/gl_context.h" | 5 #include "app/gfx/gl/gl_context.h" |
| 6 #include "gpu/command_buffer/service/gpu_processor.h" | 6 #include "gpu/command_buffer/service/gpu_processor.h" |
| 7 | 7 |
| 8 using ::base::SharedMemory; | 8 using ::base::SharedMemory; |
| 9 | 9 |
| 10 namespace gpu { | 10 namespace gpu { |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 Callback1<TransportDIB::Id>::Type* deallocator) { | 92 Callback1<TransportDIB::Id>::Type* deallocator) { |
| 93 surface_->SetTransportDIBAllocAndFree(allocator, deallocator); | 93 surface_->SetTransportDIBAllocAndFree(allocator, deallocator); |
| 94 } | 94 } |
| 95 | 95 |
| 96 uint64 GPUProcessor::GetSurfaceId() { | 96 uint64 GPUProcessor::GetSurfaceId() { |
| 97 if (!surface_.get()) | 97 if (!surface_.get()) |
| 98 return 0; | 98 return 0; |
| 99 return surface_->GetSurfaceId(); | 99 return surface_->GetSurfaceId(); |
| 100 } | 100 } |
| 101 | 101 |
| 102 uint64 GPUProcessor::swap_buffers_count() const { |
| 103 return swap_buffers_count_; |
| 104 } |
| 105 |
| 106 void GPUProcessor::set_acknowledged_swap_buffers_count( |
| 107 uint64 acknowledged_swap_buffers_count) { |
| 108 acknowledged_swap_buffers_count_ = acknowledged_swap_buffers_count; |
| 109 } |
| 110 |
| 102 void GPUProcessor::WillSwapBuffers() { | 111 void GPUProcessor::WillSwapBuffers() { |
| 103 DCHECK(decoder_.get()); | 112 DCHECK(decoder_.get()); |
| 104 DCHECK(decoder_->GetGLContext()); | 113 DCHECK(decoder_->GetGLContext()); |
| 105 DCHECK(decoder_->GetGLContext()->IsCurrent()); | 114 DCHECK(decoder_->GetGLContext()->IsCurrent()); |
| 106 | 115 |
| 116 ++swap_buffers_count_; |
| 117 |
| 107 if (surface_.get()) { | 118 if (surface_.get()) { |
| 108 surface_->SwapBuffers(); | 119 surface_->SwapBuffers(); |
| 109 } | 120 } |
| 110 | 121 |
| 111 if (wrapped_swap_buffers_callback_.get()) { | 122 if (wrapped_swap_buffers_callback_.get()) { |
| 112 wrapped_swap_buffers_callback_->Run(); | 123 wrapped_swap_buffers_callback_->Run(); |
| 113 } | 124 } |
| 114 } | 125 } |
| 115 | 126 |
| 116 } // namespace gpu | 127 } // namespace gpu |
| OLD | NEW |