| 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 #include "mojo/aura/surface_binding.h" | 5 #include "mojo/aura/surface_binding.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 #include "mojo/services/public/interfaces/surfaces/surfaces_service.mojom.h" | 28 #include "mojo/services/public/interfaces/surfaces/surfaces_service.mojom.h" |
| 29 | 29 |
| 30 namespace mojo { | 30 namespace mojo { |
| 31 namespace { | 31 namespace { |
| 32 | 32 |
| 33 // SurfaceclientImpl ----------------------------------------------------------- | 33 // SurfaceclientImpl ----------------------------------------------------------- |
| 34 | 34 |
| 35 class SurfaceClientImpl : public SurfaceClient { | 35 class SurfaceClientImpl : public SurfaceClient { |
| 36 public: | 36 public: |
| 37 SurfaceClientImpl() {} | 37 SurfaceClientImpl() {} |
| 38 virtual ~SurfaceClientImpl() {} | 38 ~SurfaceClientImpl() override {} |
| 39 | 39 |
| 40 // SurfaceClient: | 40 // SurfaceClient: |
| 41 virtual void ReturnResources(Array<ReturnedResourcePtr> resources) override { | 41 void ReturnResources(Array<ReturnedResourcePtr> resources) override { |
| 42 // TODO (sky|jamesr): figure out right way to recycle resources. | 42 // TODO (sky|jamesr): figure out right way to recycle resources. |
| 43 } | 43 } |
| 44 | 44 |
| 45 private: | 45 private: |
| 46 DISALLOW_COPY_AND_ASSIGN(SurfaceClientImpl); | 46 DISALLOW_COPY_AND_ASSIGN(SurfaceClientImpl); |
| 47 }; | 47 }; |
| 48 | 48 |
| 49 // OutputSurface --------------------------------------------------------------- | 49 // OutputSurface --------------------------------------------------------------- |
| 50 | 50 |
| 51 // OutputSurface implementation for a view. Pushes the surface id to View when | 51 // OutputSurface implementation for a view. Pushes the surface id to View when |
| 52 // appropriate. | 52 // appropriate. |
| 53 class OutputSurfaceImpl : public cc::OutputSurface { | 53 class OutputSurfaceImpl : public cc::OutputSurface { |
| 54 public: | 54 public: |
| 55 OutputSurfaceImpl(View* view, | 55 OutputSurfaceImpl(View* view, |
| 56 const scoped_refptr<cc::ContextProvider>& context_provider, | 56 const scoped_refptr<cc::ContextProvider>& context_provider, |
| 57 Surface* surface, | 57 Surface* surface, |
| 58 cc::SurfaceIdAllocator* id_allocator); | 58 cc::SurfaceIdAllocator* id_allocator); |
| 59 virtual ~OutputSurfaceImpl(); | 59 ~OutputSurfaceImpl() override; |
| 60 | 60 |
| 61 // cc::OutputSurface: | 61 // cc::OutputSurface: |
| 62 virtual void SwapBuffers(cc::CompositorFrame* frame) override; | 62 void SwapBuffers(cc::CompositorFrame* frame) override; |
| 63 | 63 |
| 64 private: | 64 private: |
| 65 View* view_; | 65 View* view_; |
| 66 Surface* surface_; | 66 Surface* surface_; |
| 67 cc::SurfaceIdAllocator* id_allocator_; | 67 cc::SurfaceIdAllocator* id_allocator_; |
| 68 cc::SurfaceId surface_id_; | 68 cc::SurfaceId surface_id_; |
| 69 gfx::Size surface_size_; | 69 gfx::Size surface_size_; |
| 70 | 70 |
| 71 DISALLOW_COPY_AND_ASSIGN(OutputSurfaceImpl); | 71 DISALLOW_COPY_AND_ASSIGN(OutputSurfaceImpl); |
| 72 }; | 72 }; |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 } | 242 } |
| 243 | 243 |
| 244 SurfaceBinding::~SurfaceBinding() { | 244 SurfaceBinding::~SurfaceBinding() { |
| 245 } | 245 } |
| 246 | 246 |
| 247 scoped_ptr<cc::OutputSurface> SurfaceBinding::CreateOutputSurface() { | 247 scoped_ptr<cc::OutputSurface> SurfaceBinding::CreateOutputSurface() { |
| 248 return state_->CreateOutputSurface(view_); | 248 return state_->CreateOutputSurface(view_); |
| 249 } | 249 } |
| 250 | 250 |
| 251 } // namespace mojo | 251 } // namespace mojo |
| OLD | NEW |