OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "ui/ozone/platform/drm/ozone_client_gbm.h" |
| 6 |
| 7 #include "ui/ozone/platform/drm/gbm_surface_client_factory.h" |
| 8 #include "ui/ozone/public/ozone_client.h" |
| 9 |
| 10 namespace ui { |
| 11 |
| 12 namespace { |
| 13 |
| 14 class OzoneClientGbm : public OzoneClient { |
| 15 public: |
| 16 OzoneClientGbm() {} |
| 17 ~OzoneClientGbm() override {} |
| 18 |
| 19 // OzoneClient: |
| 20 SurfaceClientFactoryOzone* GetSurfaceClientFactoryOzone() override { |
| 21 return surface_client_.get(); |
| 22 } |
| 23 |
| 24 void InitializeUI() override { |
| 25 if (!surface_client_) |
| 26 surface_client_.reset(new GbmSurfaceClientFactory); |
| 27 } |
| 28 |
| 29 void InitializeRenderer() override { |
| 30 if (!surface_client_) |
| 31 surface_client_.reset(new GbmSurfaceClientFactory); |
| 32 } |
| 33 |
| 34 private: |
| 35 scoped_ptr<GbmSurfaceClientFactory> surface_client_; |
| 36 |
| 37 DISALLOW_COPY_AND_ASSIGN(OzoneClientGbm); |
| 38 }; |
| 39 |
| 40 } // namespace |
| 41 |
| 42 OzoneClient* CreateOzoneClientGbm() { |
| 43 return new OzoneClientGbm; |
| 44 } |
| 45 |
| 46 } // namespace ui |
OLD | NEW |