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

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

Issue 11196014: Revert "cc: Switch to Chromium DCHECKs LOGs" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 | Annotate | Revision Log
« no previous file with comments | « cc/test/fake_web_compositor_output_surface.h ('k') | cc/test/scheduler_test_common.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef FakeWebCompositorSoftwareOutputDevice_h 5 #ifndef FakeWebCompositorSoftwareOutputDevice_h
6 #define FakeWebCompositorSoftwareOutputDevice_h 6 #define FakeWebCompositorSoftwareOutputDevice_h
7 7
8 #include "base/logging.h"
9 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
10 #include "third_party/skia/include/core/SkDevice.h" 9 #include "third_party/skia/include/core/SkDevice.h"
11 #include <public/WebCompositorSoftwareOutputDevice.h> 10 #include <public/WebCompositorSoftwareOutputDevice.h>
12 #include <public/WebImage.h> 11 #include <public/WebImage.h>
13 #include <public/WebSize.h> 12 #include <public/WebSize.h>
14 13
15 namespace WebKit { 14 namespace WebKit {
16 15
17 class FakeWebCompositorSoftwareOutputDevice : public WebCompositorSoftwareOutput Device { 16 class FakeWebCompositorSoftwareOutputDevice : public WebCompositorSoftwareOutput Device {
18 public: 17 public:
19 virtual WebImage* lock(bool forWrite) OVERRIDE 18 virtual WebImage* lock(bool forWrite) OVERRIDE
20 { 19 {
21 DCHECK(m_device.get()); 20 ASSERT(m_device.get());
22 m_image = m_device->accessBitmap(forWrite); 21 m_image = m_device->accessBitmap(forWrite);
23 return &m_image; 22 return &m_image;
24 } 23 }
25 virtual void unlock() OVERRIDE 24 virtual void unlock() OVERRIDE
26 { 25 {
27 m_image.reset(); 26 m_image.reset();
28 } 27 }
29 28
30 virtual void didChangeViewportSize(WebSize size) OVERRIDE 29 virtual void didChangeViewportSize(WebSize size) OVERRIDE
31 { 30 {
32 if (m_device.get() && size.width == m_device->width() && size.height == m_device->height()) 31 if (m_device.get() && size.width == m_device->width() && size.height == m_device->height())
33 return; 32 return;
34 33
35 m_device.reset(new SkDevice(SkBitmap::kARGB_8888_Config, size.width, siz e.height, true)); 34 m_device.reset(new SkDevice(SkBitmap::kARGB_8888_Config, size.width, siz e.height, true));
36 } 35 }
37 36
38 private: 37 private:
39 scoped_ptr<SkDevice> m_device; 38 scoped_ptr<SkDevice> m_device;
40 WebImage m_image; 39 WebImage m_image;
41 }; 40 };
42 41
43 } // namespace WebKit 42 } // namespace WebKit
44 43
45 #endif // FakeWebCompositorSoftwareOutputDevice_h 44 #endif // FakeWebCompositorSoftwareOutputDevice_h
OLDNEW
« no previous file with comments | « cc/test/fake_web_compositor_output_surface.h ('k') | cc/test/scheduler_test_common.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698