OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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 "services/gfx/compositor/graph/resource_def.h" | 5 #include "services/gfx/compositor/graph/resource_def.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 | 8 |
9 namespace compositor { | 9 namespace compositor { |
10 | 10 |
11 SceneResourceDef::SceneResourceDef(SceneDef* referenced_scene) | 11 ResourceDef::ResourceDef() {} |
12 : referenced_scene_(referenced_scene) {} | 12 |
| 13 ResourceDef::~ResourceDef() {} |
| 14 |
| 15 SceneResourceDef::SceneResourceDef( |
| 16 const mojo::gfx::composition::SceneToken& scene_token, |
| 17 const base::WeakPtr<SceneDef>& referenced_scene) |
| 18 : scene_token_(scene_token), referenced_scene_(referenced_scene) {} |
13 | 19 |
14 SceneResourceDef::~SceneResourceDef() {} | 20 SceneResourceDef::~SceneResourceDef() {} |
15 | 21 |
| 22 scoped_refptr<const SceneResourceDef> SceneResourceDef::Unlink() const { |
| 23 return new SceneResourceDef(scene_token_, base::WeakPtr<SceneDef>()); |
| 24 } |
| 25 |
16 ResourceDef::Type SceneResourceDef::type() const { | 26 ResourceDef::Type SceneResourceDef::type() const { |
17 return Type::kScene; | 27 return Type::kScene; |
18 } | 28 } |
19 | 29 |
20 ImageResourceDef::ImageResourceDef(const std::shared_ptr<RenderImage>& image) | 30 ImageResourceDef::ImageResourceDef(const std::shared_ptr<RenderImage>& image) |
21 : image_(image) { | 31 : image_(image) { |
22 DCHECK(image); | 32 DCHECK(image); |
23 } | 33 } |
24 | 34 |
25 ImageResourceDef::~ImageResourceDef() {} | 35 ImageResourceDef::~ImageResourceDef() {} |
26 | 36 |
27 ResourceDef::Type ImageResourceDef::type() const { | 37 ResourceDef::Type ImageResourceDef::type() const { |
28 return Type::kImage; | 38 return Type::kImage; |
29 } | 39 } |
30 | 40 |
31 } // namespace compositor | 41 } // namespace compositor |
OLD | NEW |