cc: Added inline to Tile::IsReadyToDraw
[chromium-blink-merge.git] / cc / output / software_output_device.h
blob788673ede9520d077ea277d571b0bc8c0c6a9ea6
1 // Copyright 2012 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 CC_OUTPUT_SOFTWARE_OUTPUT_DEVICE_H_
6 #define CC_OUTPUT_SOFTWARE_OUTPUT_DEVICE_H_
8 #include "base/basictypes.h"
9 #include "cc/base/cc_export.h"
10 #include "skia/ext/refptr.h"
11 // TODO(robertphillips): change this to "class SkBaseDevice;"
12 #include "third_party/skia/include/core/SkDevice.h"
13 #include "ui/gfx/rect.h"
14 #include "ui/gfx/size.h"
15 #include "ui/gfx/vector2d.h"
17 class SkBitmap;
18 class SkCanvas;
20 namespace cc {
22 class SoftwareFrameData;
24 // This is a "tear-off" class providing software drawing support to
25 // OutputSurface, such as to a platform-provided window framebuffer.
26 class CC_EXPORT SoftwareOutputDevice {
27 public:
28 SoftwareOutputDevice();
29 virtual ~SoftwareOutputDevice();
31 // SoftwareOutputDevice implementation.
32 virtual void Resize(gfx::Size size);
34 virtual SkCanvas* BeginPaint(gfx::Rect damage_rect);
35 virtual void EndPaint(SoftwareFrameData* frame_data);
37 virtual void CopyToBitmap(gfx::Rect rect, SkBitmap* output);
38 virtual void Scroll(gfx::Vector2d delta,
39 gfx::Rect clip_rect);
41 virtual void DiscardBackbuffer() {}
42 virtual void EnsureBackbuffer() {}
44 // TODO(skaslev) Remove this after UberCompositor lands.
45 virtual void ReclaimSoftwareFrame(unsigned id);
47 protected:
48 gfx::Size viewport_size_;
49 gfx::Rect damage_rect_;
50 skia::RefPtr<SkBaseDevice> device_;
51 skia::RefPtr<SkCanvas> canvas_;
53 private:
54 DISALLOW_COPY_AND_ASSIGN(SoftwareOutputDevice);
57 } // namespace cc
59 #endif // CC_OUTPUT_SOFTWARE_OUTPUT_DEVICE_H_