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

Side by Side Diff: examples/ui/pdf_viewer/pdf_viewer.cc

Issue 1782733002: Mozart: The great RectF-ication. (Closed) Base URL: git@github.com:domokit/mojo.git@moz-9
Patch Set: rebase 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
« no previous file with comments | « examples/ui/noodles/rasterizer.cc ('k') | examples/ui/png_viewer/png_viewer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « examples/ui/noodles/rasterizer.cc ('k') | examples/ui/png_viewer/png_viewer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698