| 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 14 matching lines...) Expand all Loading... |
| 25 void SceneContent::RecordPicture(const Snapshot* snapshot, | 25 void SceneContent::RecordPicture(const Snapshot* snapshot, |
| 26 SkCanvas* canvas) const { | 26 SkCanvas* canvas) const { |
| 27 const NodeDef* root = GetRootNodeIfExists(); | 27 const NodeDef* root = GetRootNodeIfExists(); |
| 28 if (root) | 28 if (root) |
| 29 root->RecordPicture(this, snapshot, canvas); | 29 root->RecordPicture(this, snapshot, canvas); |
| 30 } | 30 } |
| 31 | 31 |
| 32 bool SceneContent::HitTest( | 32 bool SceneContent::HitTest( |
| 33 const Snapshot* snapshot, | 33 const Snapshot* snapshot, |
| 34 const SkPoint& scene_point, | 34 const SkPoint& scene_point, |
| 35 const SkMatrix& global_to_scene_transform, | 35 const SkMatrix44& global_to_scene_transform, |
| 36 mojo::gfx::composition::SceneHitPtr* out_scene_hit) const { | 36 mojo::gfx::composition::SceneHitPtr* out_scene_hit) const { |
| 37 DCHECK(snapshot); | 37 DCHECK(snapshot); |
| 38 DCHECK(out_scene_hit); | 38 DCHECK(out_scene_hit); |
| 39 | 39 |
| 40 const NodeDef* root = GetRootNodeIfExists(); | 40 const NodeDef* root = GetRootNodeIfExists(); |
| 41 if (!root) | 41 if (!root) |
| 42 return false; | 42 return false; |
| 43 | 43 |
| 44 mojo::Array<mojo::gfx::composition::HitPtr> hits; | 44 mojo::Array<mojo::gfx::composition::HitPtr> hits; |
| 45 bool opaque = root->HitTest(this, snapshot, scene_point, | 45 bool opaque = root->HitTest(this, snapshot, scene_point, |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 } | 166 } |
| 167 | 167 |
| 168 scoped_refptr<const SceneContent> SceneContentBuilder::Build() { | 168 scoped_refptr<const SceneContent> SceneContentBuilder::Build() { |
| 169 DCHECK(content_); | 169 DCHECK(content_); |
| 170 | 170 |
| 171 const NodeDef* root = scene_->FindRootNode(); | 171 const NodeDef* root = scene_->FindRootNode(); |
| 172 return !root || AddNode(root) ? std::move(content_) : nullptr; | 172 return !root || AddNode(root) ? std::move(content_) : nullptr; |
| 173 } | 173 } |
| 174 | 174 |
| 175 } // namespace compositor | 175 } // namespace compositor |
| OLD | NEW |