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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 if (!surface_->Initialize(context.get(), false)) { | 44 if (!surface_->Initialize(context.get(), false)) { |
45 Destroy(); | 45 Destroy(); |
46 return false; | 46 return false; |
47 } | 47 } |
48 } | 48 } |
49 | 49 |
50 return InitializeCommon(context.release(), | 50 return InitializeCommon(context.release(), |
51 size, | 51 size, |
52 parent_decoder, | 52 parent_decoder, |
53 parent_texture_id); | 53 parent_texture_id); |
54 | |
55 return true; | |
56 } | 54 } |
57 | 55 |
58 void GPUProcessor::Destroy() { | 56 void GPUProcessor::Destroy() { |
59 if (surface_.get()) { | 57 if (surface_.get()) { |
60 surface_->Destroy(); | 58 surface_->Destroy(); |
61 surface_.reset(); | 59 surface_.reset(); |
62 } | 60 } |
63 | 61 |
64 DestroyCommon(); | 62 DestroyCommon(); |
65 } | 63 } |
(...skipping 26 matching lines...) Expand all Loading... |
92 surface_->SwapBuffers(); | 90 surface_->SwapBuffers(); |
93 } | 91 } |
94 | 92 |
95 if (wrapped_swap_buffers_callback_.get()) { | 93 if (wrapped_swap_buffers_callback_.get()) { |
96 wrapped_swap_buffers_callback_->Run(); | 94 wrapped_swap_buffers_callback_->Run(); |
97 } | 95 } |
98 } | 96 } |
99 | 97 |
100 } // namespace gpu | 98 } // namespace gpu |
101 | 99 |
OLD | NEW |