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

Unified Diff: cc/test/fake_web_compositor_software_output_device.cc

Issue 11474050: cc: Unify namespaces for all test files (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/test/fake_web_compositor_output_surface.cc ('k') | cc/test/fake_web_graphics_context_3d.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/test/fake_web_compositor_software_output_device.cc
diff --git a/cc/test/fake_web_compositor_software_output_device.cc b/cc/test/fake_web_compositor_software_output_device.cc
new file mode 100644
index 0000000000000000000000000000000000000000..15385b5d36e63a49589f37276bcad0a76b99a59a
--- /dev/null
+++ b/cc/test/fake_web_compositor_software_output_device.cc
@@ -0,0 +1,39 @@
+// Copyright 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "cc/test/fake_web_compositor_software_output_device.h"
+
+namespace cc {
+
+FakeWebCompositorSoftwareOutputDevice::FakeWebCompositorSoftwareOutputDevice() {
+}
+
+FakeWebCompositorSoftwareOutputDevice::
+ ~FakeWebCompositorSoftwareOutputDevice() {
+}
+
+WebKit::WebImage* FakeWebCompositorSoftwareOutputDevice::lock(bool forWrite) {
+ DCHECK(m_device.get());
+ m_image = m_device->accessBitmap(forWrite);
+ return &m_image;
+}
+
+void FakeWebCompositorSoftwareOutputDevice::unlock() {
+ m_image.reset();
+}
+
+void FakeWebCompositorSoftwareOutputDevice::didChangeViewportSize(
+ WebKit::WebSize size) {
+ if (m_device.get() && size.width == m_device->width() &&
+ size.height == m_device->height())
+ return;
+
+ m_device.reset(new SkDevice(
+ SkBitmap::kARGB_8888_Config,
+ size.width,
+ size.height,
+ true));
+}
+
+} // namespace cc
« no previous file with comments | « cc/test/fake_web_compositor_output_surface.cc ('k') | cc/test/fake_web_graphics_context_3d.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698