| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <memory> | 5 #include <memory> |
| 6 #include <string> | 6 #include <string> |
| 7 | 7 |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 | 179 |
| 180 auto update = mojo::gfx::composition::SceneUpdate::New(); | 180 auto update = mojo::gfx::composition::SceneUpdate::New(); |
| 181 mojo::gfx::composition::ResourcePtr content_resource = | 181 mojo::gfx::composition::ResourcePtr content_resource = |
| 182 ganesh_renderer()->DrawCanvas( | 182 ganesh_renderer()->DrawCanvas( |
| 183 size_, | 183 size_, |
| 184 base::Bind(&PDFDocumentView::DrawContent, base::Unretained(this))); | 184 base::Bind(&PDFDocumentView::DrawContent, base::Unretained(this))); |
| 185 DCHECK(content_resource); | 185 DCHECK(content_resource); |
| 186 update->resources.insert(kContentImageResourceId, content_resource.Pass()); | 186 update->resources.insert(kContentImageResourceId, content_resource.Pass()); |
| 187 | 187 |
| 188 auto root_node = mojo::gfx::composition::Node::New(); | 188 auto root_node = mojo::gfx::composition::Node::New(); |
| 189 root_node->hit_test_behavior = |
| 190 mojo::gfx::composition::HitTestBehavior::New(); |
| 189 root_node->op = mojo::gfx::composition::NodeOp::New(); | 191 root_node->op = mojo::gfx::composition::NodeOp::New(); |
| 190 root_node->op->set_image(mojo::gfx::composition::ImageNodeOp::New()); | 192 root_node->op->set_image(mojo::gfx::composition::ImageNodeOp::New()); |
| 191 root_node->op->get_image()->content_rect = bounds.Clone(); | 193 root_node->op->get_image()->content_rect = bounds.Clone(); |
| 192 root_node->op->get_image()->image_resource_id = kContentImageResourceId; | 194 root_node->op->get_image()->image_resource_id = kContentImageResourceId; |
| 193 update->nodes.insert(kRootNodeId, root_node.Pass()); | 195 update->nodes.insert(kRootNodeId, root_node.Pass()); |
| 194 | 196 |
| 195 scene()->Update(update.Pass()); | 197 scene()->Update(update.Pass()); |
| 196 scene()->Publish(nullptr); | 198 scene()->Publish(nullptr); |
| 197 } | 199 } |
| 198 | 200 |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 | 297 |
| 296 DISALLOW_COPY_AND_ASSIGN(PDFContentViewerApp); | 298 DISALLOW_COPY_AND_ASSIGN(PDFContentViewerApp); |
| 297 }; | 299 }; |
| 298 | 300 |
| 299 } // namespace examples | 301 } // namespace examples |
| 300 | 302 |
| 301 MojoResult MojoMain(MojoHandle application_request) { | 303 MojoResult MojoMain(MojoHandle application_request) { |
| 302 mojo::ApplicationRunnerChromium runner(new examples::PDFContentViewerApp()); | 304 mojo::ApplicationRunnerChromium runner(new examples::PDFContentViewerApp()); |
| 303 return runner.Run(application_request); | 305 return runner.Run(application_request); |
| 304 } | 306 } |
| OLD | NEW |