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

Side by Side Diff: ui/ozone/demo/renderer_base.cc

Issue 1357423009: gfx: Make conversions from Size to SizeF be explicit. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: sizefconvert-gfx: . Created 5 years, 2 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 | « ui/gfx/win/dpi.cc ('k') | ui/ozone/platform/egltest/ozone_platform_egltest.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 "ui/ozone/demo/renderer_base.h" 5 #include "ui/ozone/demo/renderer_base.h"
6 6
7 #include <cmath>
8
7 namespace ui { 9 namespace ui {
8 10
9 namespace { 11 namespace {
10 const int kAnimationSteps = 240; 12 const int kAnimationSteps = 240;
11 } // namespace 13 } // namespace
12 14
13 RendererBase::RendererBase(gfx::AcceleratedWidget widget, const gfx::Size& size) 15 RendererBase::RendererBase(gfx::AcceleratedWidget widget, const gfx::Size& size)
14 : widget_(widget), size_(size) { 16 : widget_(widget), size_(size) {
15 } 17 }
16 18
17 RendererBase::~RendererBase() { 19 RendererBase::~RendererBase() {
18 } 20 }
19 21
20 float RendererBase::NextFraction() { 22 float RendererBase::NextFraction() {
21 float fraction = (sinf(iteration_ * 2 * M_PI / kAnimationSteps) + 1) / 2; 23 float fraction = (sinf(iteration_ * 2 * M_PI / kAnimationSteps) + 1) / 2;
22 24
23 iteration_++; 25 iteration_++;
24 iteration_ %= kAnimationSteps; 26 iteration_ %= kAnimationSteps;
25 27
26 return fraction; 28 return fraction;
27 } 29 }
28 30
29 } // namespace ui 31 } // namespace ui
OLDNEW
« no previous file with comments | « ui/gfx/win/dpi.cc ('k') | ui/ozone/platform/egltest/ozone_platform_egltest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698