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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 surface_->Destroy(); | 64 surface_->Destroy(); |
65 } | 65 } |
66 surface_.reset(); | 66 surface_.reset(); |
67 #endif | 67 #endif |
68 DestroyCommon(); | 68 DestroyCommon(); |
69 } | 69 } |
70 | 70 |
71 uint64 GPUProcessor::SetWindowSizeForIOSurface(const gfx::Size& size) { | 71 uint64 GPUProcessor::SetWindowSizeForIOSurface(const gfx::Size& size) { |
72 #if !defined(UNIT_TEST) | 72 #if !defined(UNIT_TEST) |
73 ResizeOffscreenFrameBuffer(size); | 73 ResizeOffscreenFrameBuffer(size); |
| 74 decoder_->UpdateOffscreenFrameBufferSize(); |
74 return surface_->SetSurfaceSize(size); | 75 return surface_->SetSurfaceSize(size); |
75 #else | 76 #else |
76 return 0; | 77 return 0; |
77 #endif | 78 #endif |
78 } | 79 } |
79 | 80 |
80 TransportDIB::Handle GPUProcessor::SetWindowSizeForTransportDIB( | 81 TransportDIB::Handle GPUProcessor::SetWindowSizeForTransportDIB( |
81 const gfx::Size& size) { | 82 const gfx::Size& size) { |
82 #if !defined(UNIT_TEST) | 83 #if !defined(UNIT_TEST) |
83 ResizeOffscreenFrameBuffer(size); | 84 ResizeOffscreenFrameBuffer(size); |
| 85 decoder_->UpdateOffscreenFrameBufferSize(); |
84 return surface_->SetTransportDIBSize(size); | 86 return surface_->SetTransportDIBSize(size); |
85 #else | 87 #else |
86 return TransportDIB::DefaultHandleValue(); | 88 return TransportDIB::DefaultHandleValue(); |
87 #endif | 89 #endif |
88 } | 90 } |
89 | 91 |
90 void GPUProcessor::SetTransportDIBAllocAndFree( | 92 void GPUProcessor::SetTransportDIBAllocAndFree( |
91 Callback2<size_t, TransportDIB::Handle*>::Type* allocator, | 93 Callback2<size_t, TransportDIB::Handle*>::Type* allocator, |
92 Callback1<TransportDIB::Id>::Type* deallocator) { | 94 Callback1<TransportDIB::Id>::Type* deallocator) { |
93 #if !defined(UNIT_TEST) | 95 #if !defined(UNIT_TEST) |
94 surface_->SetTransportDIBAllocAndFree(allocator, deallocator); | 96 surface_->SetTransportDIBAllocAndFree(allocator, deallocator); |
95 #endif | 97 #endif |
96 } | 98 } |
97 | 99 |
98 void GPUProcessor::WillSwapBuffers() { | 100 void GPUProcessor::WillSwapBuffers() { |
99 DCHECK(context_->IsCurrent()); | 101 DCHECK(context_->IsCurrent()); |
100 #if !defined(UNIT_TEST) | 102 #if !defined(UNIT_TEST) |
101 if (surface_.get()) { | 103 if (surface_.get()) { |
102 surface_->SwapBuffers(); | 104 surface_->SwapBuffers(); |
103 } | 105 } |
104 #endif | 106 #endif |
105 | 107 |
106 if (wrapped_swap_buffers_callback_.get()) { | 108 if (wrapped_swap_buffers_callback_.get()) { |
107 wrapped_swap_buffers_callback_->Run(); | 109 wrapped_swap_buffers_callback_->Run(); |
108 } | 110 } |
109 } | 111 } |
110 | 112 |
111 } // namespace gpu | 113 } // namespace gpu |
112 | 114 |
OLD | NEW |