Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_SURFACES_SURFACE_FACTORY_H_ | 5 #ifndef CC_SURFACES_SURFACE_FACTORY_H_ |
| 6 #define CC_SURFACES_SURFACE_FACTORY_H_ | 6 #define CC_SURFACES_SURFACE_FACTORY_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 54 const DrawCallback& callback); | 54 const DrawCallback& callback); |
| 55 void RequestCopyOfSurface(SurfaceId surface_id, | 55 void RequestCopyOfSurface(SurfaceId surface_id, |
| 56 scoped_ptr<CopyOutputRequest> copy_request); | 56 scoped_ptr<CopyOutputRequest> copy_request); |
| 57 | 57 |
| 58 SurfaceFactoryClient* client() { return client_; } | 58 SurfaceFactoryClient* client() { return client_; } |
| 59 | 59 |
| 60 void ReceiveFromChild(const TransferableResourceArray& resources); | 60 void ReceiveFromChild(const TransferableResourceArray& resources); |
| 61 void RefResources(const TransferableResourceArray& resources); | 61 void RefResources(const TransferableResourceArray& resources); |
| 62 void UnrefResources(const ReturnedResourceArray& resources); | 62 void UnrefResources(const ReturnedResourceArray& resources); |
| 63 | 63 |
| 64 SurfaceManager* manager() { return manager_; } | 64 SurfaceManager* manager() const { return manager_; } |
|
rjkroege
2015/09/16 21:31:37
You can land this in isolation?
Fady Samuel
2015/09/17 18:31:42
Done.
| |
| 65 | 65 |
| 66 // This can be set to false if resources from this SurfaceFactory don't need | 66 // This can be set to false if resources from this SurfaceFactory don't need |
| 67 // to have sync points set on them when returned from the Display, for | 67 // to have sync points set on them when returned from the Display, for |
| 68 // example if the Display shares a context with the creator. | 68 // example if the Display shares a context with the creator. |
| 69 bool needs_sync_points() const { return needs_sync_points_; } | 69 bool needs_sync_points() const { return needs_sync_points_; } |
| 70 void set_needs_sync_points(bool needs) { needs_sync_points_ = needs; } | 70 void set_needs_sync_points(bool needs) { needs_sync_points_ = needs; } |
| 71 | 71 |
| 72 private: | 72 private: |
| 73 SurfaceManager* manager_; | 73 SurfaceManager* manager_; |
| 74 SurfaceFactoryClient* client_; | 74 SurfaceFactoryClient* client_; |
| 75 SurfaceResourceHolder holder_; | 75 SurfaceResourceHolder holder_; |
| 76 | 76 |
| 77 bool needs_sync_points_; | 77 bool needs_sync_points_; |
| 78 | 78 |
| 79 typedef base::ScopedPtrHashMap<SurfaceId, scoped_ptr<Surface>> | 79 typedef base::ScopedPtrHashMap<SurfaceId, scoped_ptr<Surface>> |
| 80 OwningSurfaceMap; | 80 OwningSurfaceMap; |
| 81 OwningSurfaceMap surface_map_; | 81 OwningSurfaceMap surface_map_; |
| 82 | 82 |
| 83 DISALLOW_COPY_AND_ASSIGN(SurfaceFactory); | 83 DISALLOW_COPY_AND_ASSIGN(SurfaceFactory); |
| 84 }; | 84 }; |
| 85 | 85 |
| 86 } // namespace cc | 86 } // namespace cc |
| 87 | 87 |
| 88 #endif // CC_SURFACES_SURFACE_FACTORY_H_ | 88 #endif // CC_SURFACES_SURFACE_FACTORY_H_ |
| OLD | NEW |