| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #ifndef CC_TEST_FAKE_OUTPUT_SURFACE_H_ | 5 #ifndef CC_TEST_FAKE_OUTPUT_SURFACE_H_ |
| 6 #define CC_TEST_FAKE_OUTPUT_SURFACE_H_ | 6 #define CC_TEST_FAKE_OUTPUT_SURFACE_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 return make_scoped_ptr(new FakeOutputSurface( | 59 return make_scoped_ptr(new FakeOutputSurface( |
| 60 TestContextProvider::Create(context.Pass()), true)); | 60 TestContextProvider::Create(context.Pass()), true)); |
| 61 } | 61 } |
| 62 | 62 |
| 63 static scoped_ptr<FakeOutputSurface> CreateDelegatingSoftware( | 63 static scoped_ptr<FakeOutputSurface> CreateDelegatingSoftware( |
| 64 scoped_ptr<SoftwareOutputDevice> software_device) { | 64 scoped_ptr<SoftwareOutputDevice> software_device) { |
| 65 return make_scoped_ptr( | 65 return make_scoped_ptr( |
| 66 new FakeOutputSurface(software_device.Pass(), true)); | 66 new FakeOutputSurface(software_device.Pass(), true)); |
| 67 } | 67 } |
| 68 | 68 |
| 69 // TODO(boliu): Use a general factory that takes Capabilities arg. | |
| 70 static scoped_ptr<FakeOutputSurface> CreateDeferredGL( | 69 static scoped_ptr<FakeOutputSurface> CreateDeferredGL( |
| 71 scoped_ptr<SoftwareOutputDevice> software_device) { | 70 scoped_ptr<SoftwareOutputDevice> software_device, |
| 71 bool delegated_rendering) { |
| 72 scoped_ptr<FakeOutputSurface> result( | 72 scoped_ptr<FakeOutputSurface> result( |
| 73 new FakeOutputSurface(software_device.Pass(), false)); | 73 new FakeOutputSurface(software_device.Pass(), delegated_rendering)); |
| 74 result->capabilities_.deferred_gl_initialization = true; | 74 result->capabilities_.deferred_gl_initialization = true; |
| 75 return result.Pass(); | 75 return result.Pass(); |
| 76 } | 76 } |
| 77 | 77 |
| 78 static scoped_ptr<FakeOutputSurface> CreateAlwaysDrawAndSwap3d() { | 78 static scoped_ptr<FakeOutputSurface> CreateAlwaysDrawAndSwap3d() { |
| 79 scoped_ptr<FakeOutputSurface> surface(Create3d()); | 79 scoped_ptr<FakeOutputSurface> surface(Create3d()); |
| 80 surface->capabilities_.draw_and_swap_full_viewport_every_frame = true; | 80 surface->capabilities_.draw_and_swap_full_viewport_every_frame = true; |
| 81 return surface.Pass(); | 81 return surface.Pass(); |
| 82 } | 82 } |
| 83 | 83 |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 bool forced_draw_to_software_device_; | 147 bool forced_draw_to_software_device_; |
| 148 bool has_external_stencil_test_; | 148 bool has_external_stencil_test_; |
| 149 TransferableResourceArray resources_held_by_parent_; | 149 TransferableResourceArray resources_held_by_parent_; |
| 150 base::WeakPtrFactory<FakeOutputSurface> fake_weak_ptr_factory_; | 150 base::WeakPtrFactory<FakeOutputSurface> fake_weak_ptr_factory_; |
| 151 scoped_ptr<ManagedMemoryPolicy> memory_policy_to_set_at_bind_; | 151 scoped_ptr<ManagedMemoryPolicy> memory_policy_to_set_at_bind_; |
| 152 }; | 152 }; |
| 153 | 153 |
| 154 } // namespace cc | 154 } // namespace cc |
| 155 | 155 |
| 156 #endif // CC_TEST_FAKE_OUTPUT_SURFACE_H_ | 156 #endif // CC_TEST_FAKE_OUTPUT_SURFACE_H_ |
| OLD | NEW |