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 "ui/compositor/compositor.h" | 5 #include "ui/compositor/compositor.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <deque> | 8 #include <deque> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 using webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl; | 118 using webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl; |
119 scoped_ptr<WebGraphicsContext3DInProcessCommandBufferImpl> context3d( | 119 scoped_ptr<WebGraphicsContext3DInProcessCommandBufferImpl> context3d( |
120 WebGraphicsContext3DInProcessCommandBufferImpl::CreateViewContext( | 120 WebGraphicsContext3DInProcessCommandBufferImpl::CreateViewContext( |
121 attrs, compositor->widget())); | 121 attrs, compositor->widget())); |
122 CHECK(context3d); | 122 CHECK(context3d); |
123 | 123 |
124 using webkit::gpu::ContextProviderInProcess; | 124 using webkit::gpu::ContextProviderInProcess; |
125 scoped_refptr<ContextProviderInProcess> context_provider = | 125 scoped_refptr<ContextProviderInProcess> context_provider = |
126 ContextProviderInProcess::Create(context3d.Pass()); | 126 ContextProviderInProcess::Create(context3d.Pass()); |
127 | 127 |
128 return make_scoped_ptr(new cc::OutputSurface(context_provider)); | 128 return make_scoped_ptr(new cc::OutputSurface( |
| 129 context_provider, |
| 130 cc::OutputSurface::kDefaultMaxTransferBufferUsageBytes)); |
129 } | 131 } |
130 | 132 |
131 scoped_refptr<Reflector> DefaultContextFactory::CreateReflector( | 133 scoped_refptr<Reflector> DefaultContextFactory::CreateReflector( |
132 Compositor* mirroed_compositor, | 134 Compositor* mirroed_compositor, |
133 Layer* mirroring_layer) { | 135 Layer* mirroring_layer) { |
134 return NULL; | 136 return NULL; |
135 } | 137 } |
136 | 138 |
137 void DefaultContextFactory::RemoveReflector( | 139 void DefaultContextFactory::RemoveReflector( |
138 scoped_refptr<Reflector> reflector) { | 140 scoped_refptr<Reflector> reflector) { |
(...skipping 27 matching lines...) Expand all Loading... |
166 | 168 |
167 bool DefaultContextFactory::DoesCreateTestContexts() { return false; } | 169 bool DefaultContextFactory::DoesCreateTestContexts() { return false; } |
168 | 170 |
169 TestContextFactory::TestContextFactory() {} | 171 TestContextFactory::TestContextFactory() {} |
170 | 172 |
171 TestContextFactory::~TestContextFactory() {} | 173 TestContextFactory::~TestContextFactory() {} |
172 | 174 |
173 scoped_ptr<cc::OutputSurface> TestContextFactory::CreateOutputSurface( | 175 scoped_ptr<cc::OutputSurface> TestContextFactory::CreateOutputSurface( |
174 Compositor* compositor) { | 176 Compositor* compositor) { |
175 return make_scoped_ptr( | 177 return make_scoped_ptr( |
176 new cc::OutputSurface(cc::TestContextProvider::Create())); | 178 new cc::OutputSurface( |
| 179 cc::TestContextProvider::Create(), |
| 180 cc::OutputSurface::kDefaultMaxTransferBufferUsageBytes)); |
177 } | 181 } |
178 | 182 |
179 scoped_refptr<Reflector> TestContextFactory::CreateReflector( | 183 scoped_refptr<Reflector> TestContextFactory::CreateReflector( |
180 Compositor* mirrored_compositor, | 184 Compositor* mirrored_compositor, |
181 Layer* mirroring_layer) { | 185 Layer* mirroring_layer) { |
182 return new Reflector(); | 186 return new Reflector(); |
183 } | 187 } |
184 | 188 |
185 void TestContextFactory::RemoveReflector(scoped_refptr<Reflector> reflector) { | 189 void TestContextFactory::RemoveReflector(scoped_refptr<Reflector> reflector) { |
186 } | 190 } |
(...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
764 } | 768 } |
765 | 769 |
766 void Compositor::NotifyEnd() { | 770 void Compositor::NotifyEnd() { |
767 last_ended_frame_++; | 771 last_ended_frame_++; |
768 FOR_EACH_OBSERVER(CompositorObserver, | 772 FOR_EACH_OBSERVER(CompositorObserver, |
769 observer_list_, | 773 observer_list_, |
770 OnCompositingEnded(this)); | 774 OnCompositingEnded(this)); |
771 } | 775 } |
772 | 776 |
773 } // namespace ui | 777 } // namespace ui |
OLD | NEW |