OLD | NEW |
(Empty) | |
| 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. |
| 4 |
| 5 #include "cc/test/fake_web_compositor_software_output_device.h" |
| 6 |
| 7 namespace cc { |
| 8 |
| 9 FakeWebCompositorSoftwareOutputDevice::FakeWebCompositorSoftwareOutputDevice() { |
| 10 } |
| 11 |
| 12 FakeWebCompositorSoftwareOutputDevice:: |
| 13 ~FakeWebCompositorSoftwareOutputDevice() { |
| 14 } |
| 15 |
| 16 WebKit::WebImage* FakeWebCompositorSoftwareOutputDevice::lock(bool forWrite) { |
| 17 DCHECK(m_device.get()); |
| 18 m_image = m_device->accessBitmap(forWrite); |
| 19 return &m_image; |
| 20 } |
| 21 |
| 22 void FakeWebCompositorSoftwareOutputDevice::unlock() { |
| 23 m_image.reset(); |
| 24 } |
| 25 |
| 26 void FakeWebCompositorSoftwareOutputDevice::didChangeViewportSize( |
| 27 WebKit::WebSize size) { |
| 28 if (m_device.get() && size.width == m_device->width() && |
| 29 size.height == m_device->height()) |
| 30 return; |
| 31 |
| 32 m_device.reset(new SkDevice( |
| 33 SkBitmap::kARGB_8888_Config, |
| 34 size.width, |
| 35 size.height, |
| 36 true)); |
| 37 } |
| 38 |
| 39 } // namespace cc |
OLD | NEW |