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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 callback.Run(true); | 166 callback.Run(true); |
167 return; | 167 return; |
168 } | 168 } |
169 | 169 |
170 callback.Run(false); | 170 callback.Run(false); |
171 } | 171 } |
172 | 172 |
173 // |ChoreographerDelegate|: | 173 // |ChoreographerDelegate|: |
174 void OnDraw(const mojo::gfx::composition::FrameInfo& frame_info, | 174 void OnDraw(const mojo::gfx::composition::FrameInfo& frame_info, |
175 const base::TimeDelta& time_delta) override { | 175 const base::TimeDelta& time_delta) override { |
176 mojo::Rect bounds; | 176 mojo::RectF bounds; |
177 bounds.width = size_.width; | 177 bounds.width = size_.width; |
178 bounds.height = size_.height; | 178 bounds.height = size_.height; |
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()); |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 | 297 |
298 DISALLOW_COPY_AND_ASSIGN(PDFContentViewerApp); | 298 DISALLOW_COPY_AND_ASSIGN(PDFContentViewerApp); |
299 }; | 299 }; |
300 | 300 |
301 } // namespace examples | 301 } // namespace examples |
302 | 302 |
303 MojoResult MojoMain(MojoHandle application_request) { | 303 MojoResult MojoMain(MojoHandle application_request) { |
304 mojo::ApplicationRunnerChromium runner(new examples::PDFContentViewerApp()); | 304 mojo::ApplicationRunnerChromium runner(new examples::PDFContentViewerApp()); |
305 return runner.Run(application_request); | 305 return runner.Run(application_request); |
306 } | 306 } |
OLD | NEW |