Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(25)

Side by Side Diff: cc/test/FakeWebCompositorSoftwareOutputDevice.h

Issue 10918258: Add CC software renderer. (Closed) Base URL: http://git.chromium.org/chromium/src.git@gladapter
Patch Set: Fix license headers Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/test/FakeWebCompositorOutputSurface.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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 #ifndef FakeWebCompositorSoftwareOutputDevice_h
6 #define FakeWebCompositorSoftwareOutputDevice_h
7
8 #include "SkDevice.h"
9 #include <public/WebCompositorSoftwareOutputDevice.h>
10 #include <public/WebImage.h>
11 #include <public/WebSize.h>
12 #include <wtf/OwnPtr.h>
13 #include <wtf/PassOwnPtr.h>
14
15 namespace WebKit {
16
17 class FakeWebCompositorSoftwareOutputDevice : public WebCompositorSoftwareOutput Device {
18 public:
19 virtual WebImage* lock(bool forWrite) OVERRIDE
20 {
21 ASSERT(m_device);
22 m_image = m_device->accessBitmap(forWrite);
23 return &m_image;
24 }
25 virtual void unlock() OVERRIDE
26 {
27 m_image.reset();
28 }
29
30 virtual void didChangeViewportSize(WebSize size) OVERRIDE
31 {
32 if (m_device.get() && size.width == m_device->width() && size.height == m_device->height())
33 return;
34
35 m_device = adoptPtr(new SkDevice(SkBitmap::kARGB_8888_Config, size.width , size.height, true));
36 }
37
38 private:
39 OwnPtr<SkDevice> m_device;
40 WebImage m_image;
41 };
42
43 } // namespace WebKit
44
45 #endif // FakeWebCompositorSoftwareOutputDevice_h
OLDNEW
« no previous file with comments | « cc/test/FakeWebCompositorOutputSurface.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698