summaryrefslogtreecommitdiffstats
path: root/cc/test/fake_software_output_device.h
blob: 0ee28a3be891911c734198e3a94829a18fda3b56 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Copyright 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CC_TEST_FAKE_SOFTWARE_OUTPUT_DEVICE_H_
#define CC_TEST_FAKE_SOFTWARE_OUTPUT_DEVICE_H_

#include "base/logging.h"
#include "cc/software_output_device.h"
#include "skia/ext/refptr.h"
#include "third_party/WebKit/Source/Platform/chromium/public/WebImage.h"
#include "third_party/skia/include/core/SkDevice.h"

namespace cc {

class FakeSoftwareOutputDevice : public SoftwareOutputDevice {
 public:
  FakeSoftwareOutputDevice();
  virtual ~FakeSoftwareOutputDevice();

  virtual WebKit::WebImage* Lock(bool forWrite) OVERRIDE;
  virtual void Unlock() OVERRIDE;

  virtual void DidChangeViewportSize(gfx::Size size) OVERRIDE;

 private:
  skia::RefPtr<SkDevice> device_;
  WebKit::WebImage image_;
};

}  // namespace cc

#endif  // CC_TEST_FAKE_SOFTWARE_OUTPUT_DEVICE_H_