Update V8 to version 4.7.45.
[chromium-blink-merge.git] / ui / ozone / demo / renderer_base.cc
blob9d7d6e24c7339e1c4ed46f3932ff35ab0507f95b
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
3 // found in the LICENSE file.
5 #include "ui/ozone/demo/renderer_base.h"
7 namespace ui {
9 namespace {
10 const int kAnimationSteps = 240;
11 } // namespace
13 RendererBase::RendererBase(gfx::AcceleratedWidget widget, const gfx::Size& size)
14 : widget_(widget), size_(size) {
17 RendererBase::~RendererBase() {
20 float RendererBase::NextFraction() {
21 float fraction = (sinf(iteration_ * 2 * M_PI / kAnimationSteps) + 1) / 2;
23 iteration_++;
24 iteration_ %= kAnimationSteps;
26 return fraction;
29 } // namespace ui