blob: 0581b2b5b8ae3294c362abeb9755214cb4dcd8ad [file] [log] [blame]
[email protected]a46f32932012-12-07 21:43:161// 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.
4
5#ifndef CC_SOFTWARE_OUTPUT_DEVICE_H_
6#define CC_SOFTWARE_OUTPUT_DEVICE_H_
7
8#include "third_party/WebKit/Source/Platform/chromium/public/WebImage.h"
9#include "ui/gfx/size.h"
10
11namespace cc {
12
13// This is a "tear-off" class providing software drawing support to
14// OutputSurface, such as to a platform-provided window framebuffer.
15class SoftwareOutputDevice {
16 public:
17 virtual ~SoftwareOutputDevice() {}
18
19 // Lock the framebuffer and return a pointer to a WebImage referring to its
20 // pixels. Set forWrite if you intend to change the pixels. Readback
21 // is supported whether or not forWrite is set.
22 // TODO(danakj): Switch this from WebImage to a Skia type.
23 virtual WebKit::WebImage* Lock(bool forWrite) = 0;
24 virtual void Unlock() = 0;
25
26 virtual void DidChangeViewportSize(gfx::Size) = 0;
27};
28
29} // namespace cc
30
31#endif // CC_SOFTWARE_OUTPUT_DEVICE_H_