WebKit Roll 139512:139548
[chromium-blink-merge.git] / cc / software_output_device.h
blob0581b2b5b8ae3294c362abeb9755214cb4dcd8ad
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_SOFTWARE_OUTPUT_DEVICE_H_
6 #define CC_SOFTWARE_OUTPUT_DEVICE_H_
8 #include "third_party/WebKit/Source/Platform/chromium/public/WebImage.h"
9 #include "ui/gfx/size.h"
11 namespace cc {
13 // This is a "tear-off" class providing software drawing support to
14 // OutputSurface, such as to a platform-provided window framebuffer.
15 class SoftwareOutputDevice {
16 public:
17 virtual ~SoftwareOutputDevice() {}
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;
26 virtual void DidChangeViewportSize(gfx::Size) = 0;
29 } // namespace cc
31 #endif // CC_SOFTWARE_OUTPUT_DEVICE_H_