| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/scene_content.h" | 5 #include "services/gfx/compositor/graph/scene_content.h" |
| 6 | 6 |
| 7 #include <ostream> | 7 #include <ostream> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "services/gfx/compositor/graph/scene_def.h" | 10 #include "services/gfx/compositor/graph/scene_def.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 nodes_(max_nodes) {} | 23 nodes_(max_nodes) {} |
| 24 | 24 |
| 25 SceneContent::~SceneContent() {} | 25 SceneContent::~SceneContent() {} |
| 26 | 26 |
| 27 bool SceneContent::MatchesVersion(uint32_t requested_version) const { | 27 bool SceneContent::MatchesVersion(uint32_t requested_version) const { |
| 28 return requested_version == mojo::gfx::composition::kSceneVersionNone || | 28 return requested_version == mojo::gfx::composition::kSceneVersionNone || |
| 29 requested_version == version_ || | 29 requested_version == version_ || |
| 30 version_ == mojo::gfx::composition::kSceneVersionNone; | 30 version_ == mojo::gfx::composition::kSceneVersionNone; |
| 31 } | 31 } |
| 32 | 32 |
| 33 void SceneContent::RecordPicture(const Snapshot* snapshot, | 33 void SceneContent::Paint(const Snapshot* snapshot, SkCanvas* canvas) const { |
| 34 SkCanvas* canvas) const { | |
| 35 const Node* root = GetRootNodeIfExists(); | 34 const Node* root = GetRootNodeIfExists(); |
| 36 if (root) | 35 if (root) |
| 37 root->RecordPicture(this, snapshot, canvas); | 36 root->Paint(this, snapshot, canvas); |
| 38 } | 37 } |
| 39 | 38 |
| 40 bool SceneContent::HitTest( | 39 bool SceneContent::HitTest( |
| 41 const Snapshot* snapshot, | 40 const Snapshot* snapshot, |
| 42 const SkPoint& scene_point, | 41 const SkPoint& scene_point, |
| 43 const SkMatrix44& global_to_scene_transform, | 42 const SkMatrix44& global_to_scene_transform, |
| 44 mojo::gfx::composition::SceneHitPtr* out_scene_hit) const { | 43 mojo::gfx::composition::SceneHitPtr* out_scene_hit) const { |
| 45 DCHECK(snapshot); | 44 DCHECK(snapshot); |
| 46 DCHECK(out_scene_hit); | 45 DCHECK(out_scene_hit); |
| 47 | 46 |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 } | 173 } |
| 175 | 174 |
| 176 scoped_refptr<const SceneContent> SceneContentBuilder::Build() { | 175 scoped_refptr<const SceneContent> SceneContentBuilder::Build() { |
| 177 DCHECK(content_); | 176 DCHECK(content_); |
| 178 | 177 |
| 179 const Node* root = FindNode(mojo::gfx::composition::kSceneRootNodeId); | 178 const Node* root = FindNode(mojo::gfx::composition::kSceneRootNodeId); |
| 180 return !root || AddNode(root) ? std::move(content_) : nullptr; | 179 return !root || AddNode(root) ? std::move(content_) : nullptr; |
| 181 } | 180 } |
| 182 | 181 |
| 183 } // namespace compositor | 182 } // namespace compositor |
| OLD | NEW |