Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(284)

Side by Side Diff: services/gfx/compositor/graph/resource_def.cc

Issue 1749063002: Mozart: Improve internal scene graph representation. (Closed) Base URL: git@github.com:domokit/mojo.git@moz-0
Patch Set: avoid unnecessary hashtable lookups Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
OLDNEW
« no previous file with comments | « services/gfx/compositor/graph/resource_def.h ('k') | services/gfx/compositor/graph/scene_content.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698