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 "webkit/compositor_bindings/web_compositor_support_software_output_devi
ce.h" |
| 6 |
| 7 namespace webkit { |
| 8 |
| 9 WebCompositorSupportSoftwareOutputDevice:: |
| 10 WebCompositorSupportSoftwareOutputDevice() {} |
| 11 |
| 12 WebCompositorSupportSoftwareOutputDevice:: |
| 13 ~WebCompositorSupportSoftwareOutputDevice() {} |
| 14 |
| 15 WebKit::WebImage* WebCompositorSupportSoftwareOutputDevice::Lock( |
| 16 bool forWrite) { |
| 17 DCHECK(device_); |
| 18 image_ = device_->accessBitmap(forWrite); |
| 19 return &image_; |
| 20 } |
| 21 |
| 22 void WebCompositorSupportSoftwareOutputDevice::Unlock() { |
| 23 image_.reset(); |
| 24 } |
| 25 |
| 26 void WebCompositorSupportSoftwareOutputDevice::DidChangeViewportSize( |
| 27 gfx::Size size) { |
| 28 if (device_.get() && |
| 29 size.width() == device_->width() && |
| 30 size.height() == device_->height()) |
| 31 return; |
| 32 |
| 33 device_ = skia::AdoptRef(new SkDevice( |
| 34 SkBitmap::kARGB_8888_Config, size.width(), size.height(), true)); |
| 35 } |
| 36 |
| 37 } // namespace webkit |
OLD | NEW |