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 #ifndef UI_OZONE_DEMO_SOFTWARE_RENDERER_H_
6 #define UI_OZONE_DEMO_SOFTWARE_RENDERER_H_
8 #include "base/macros.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "base/memory/weak_ptr.h"
11 #include "base/timer/timer.h"
12 #include "ui/ozone/demo/renderer_base.h"
20 class SurfaceOzoneCanvas
;
22 class SoftwareRenderer
: public RendererBase
{
24 SoftwareRenderer(gfx::AcceleratedWidget widget
, const gfx::Size
& size
);
25 ~SoftwareRenderer() override
;
28 bool Initialize() override
;
33 void UpdateVSyncParameters(const base::TimeTicks timebase
,
34 const base::TimeDelta interval
);
36 scoped_ptr
<SurfaceOzoneCanvas
> software_surface_
;
38 scoped_ptr
<gfx::VSyncProvider
> vsync_provider_
;
40 // Timer for animation.
41 base::RepeatingTimer
<SoftwareRenderer
> timer_
;
43 base::TimeDelta vsync_period_
;
45 base::WeakPtrFactory
<SoftwareRenderer
> weak_ptr_factory_
;
47 DISALLOW_COPY_AND_ASSIGN(SoftwareRenderer
);
52 #endif // UI_OZONE_DEMO_SOFTWARE_RENDERER_H_