Enabling tests which should be fixed by r173829.
[chromium-blink-merge.git] / cc / test / fake_software_output_device.cc
blobeebf2b97772bc68ee259f2d9c238101ac1b9b267
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 #include "cc/test/fake_software_output_device.h"
7 namespace cc {
9 FakeSoftwareOutputDevice::FakeSoftwareOutputDevice() {}
11 FakeSoftwareOutputDevice::~FakeSoftwareOutputDevice() {}
13 WebKit::WebImage* FakeSoftwareOutputDevice::Lock(bool forWrite) {
14 DCHECK(device_);
15 image_ = device_->accessBitmap(forWrite);
16 return &image_;
19 void FakeSoftwareOutputDevice::Unlock() {
20 image_.reset();
23 void FakeSoftwareOutputDevice::DidChangeViewportSize(gfx::Size size) {
24 if (device_.get() &&
25 size.width() == device_->width() &&
26 size.height() == device_->height())
27 return;
29 device_ = skia::AdoptRef(new SkDevice(
30 SkBitmap::kARGB_8888_Config, size.width(), size.height(), true));
33 } // namespace cc