summaryrefslogtreecommitdiffstats
path: root/cc/test
diff options
context:
space:
mode:
authordanakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-06 02:32:40 +0000
committerdanakj@chromium.org <danakj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-06 02:32:40 +0000
commitda983ab0f33178103ea9788a34963a95ac9606e6 (patch)
treec49562355e99010922b7468466384871bb7e75fd /cc/test
parent7cc78904e5c3c8c8a25862cf107bf9e422fa6ce1 (diff)
downloadchromium_src-da983ab0f33178103ea9788a34963a95ac9606e6.zip
chromium_src-da983ab0f33178103ea9788a34963a95ac9606e6.tar.gz
chromium_src-da983ab0f33178103ea9788a34963a95ac9606e6.tar.bz2
cc: Allow a renderer to disallow partial texture updates.
This is required for delegating renderer, as textures used by the renderer can not be used by the texture updater while the renderer has ownership of them, since it ships them out of process. BUG=146080 R=piman,enne Review URL: https://chromiumcodereview.appspot.com/11457003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@171385 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/test')
-rw-r--r--cc/test/fake_layer_tree_host_client.cc4
-rw-r--r--cc/test/fake_layer_tree_host_client.h8
-rw-r--r--cc/test/fake_proxy.cc22
-rw-r--r--cc/test/fake_proxy.h4
4 files changed, 32 insertions, 6 deletions
diff --git a/cc/test/fake_layer_tree_host_client.cc b/cc/test/fake_layer_tree_host_client.cc
index 030142b..a2833b3 100644
--- a/cc/test/fake_layer_tree_host_client.cc
+++ b/cc/test/fake_layer_tree_host_client.cc
@@ -8,6 +8,10 @@ namespace cc {
scoped_ptr<WebKit::WebCompositorOutputSurface> FakeLayerImplTreeHostClient::createOutputSurface()
{
+ if (m_useSoftwareRendering) {
+ return WebKit::FakeWebCompositorOutputSurface::createSoftware(make_scoped_ptr(new WebKit::FakeWebCompositorSoftwareOutputDevice).PassAs<WebKit::WebCompositorSoftwareOutputDevice>()).PassAs<WebKit::WebCompositorOutputSurface>();
+ }
+
WebKit::WebGraphicsContext3D::Attributes attrs;
return WebKit::FakeWebCompositorOutputSurface::create(WebKit::CompositorFakeWebGraphicsContext3D::create(attrs).PassAs<WebKit::WebGraphicsContext3D>()).PassAs<WebKit::WebCompositorOutputSurface>();
}
diff --git a/cc/test/fake_layer_tree_host_client.h b/cc/test/fake_layer_tree_host_client.h
index 321e926..8d0cfd6 100644
--- a/cc/test/fake_layer_tree_host_client.h
+++ b/cc/test/fake_layer_tree_host_client.h
@@ -15,6 +15,11 @@ namespace cc {
class FakeLayerImplTreeHostClient : public LayerTreeHostClient {
public:
+ FakeLayerImplTreeHostClient(bool useSoftwareRendering = false)
+ : m_useSoftwareRendering(useSoftwareRendering)
+ {
+ }
+
virtual void willBeginFrame() OVERRIDE { }
virtual void didBeginFrame() OVERRIDE { }
virtual void animate(double monotonicFrameBeginTime) OVERRIDE { }
@@ -33,6 +38,9 @@ public:
virtual void scheduleComposite() OVERRIDE { }
virtual scoped_ptr<FontAtlas> createFontAtlas() OVERRIDE;
+
+private:
+ bool m_useSoftwareRendering;
};
}
diff --git a/cc/test/fake_proxy.cc b/cc/test/fake_proxy.cc
index d6dbb40..d485056 100644
--- a/cc/test/fake_proxy.cc
+++ b/cc/test/fake_proxy.cc
@@ -8,27 +8,27 @@ namespace cc {
bool FakeProxy::compositeAndReadback(void *pixels, const gfx::Rect&)
{
- return false;
+ return true;
}
bool FakeProxy::isStarted() const
{
- return false;
+ return true;
}
bool FakeProxy::initializeContext()
{
- return false;
+ return true;
}
bool FakeProxy::initializeRenderer()
{
- return false;
+ return true;
}
bool FakeProxy::recreateContext()
{
- return false;
+ return true;
}
const RendererCapabilities& FakeProxy::rendererCapabilities() const
@@ -36,6 +36,11 @@ const RendererCapabilities& FakeProxy::rendererCapabilities() const
return m_capabilities;
}
+RendererCapabilities& FakeProxy::rendererCapabilities()
+{
+ return m_capabilities;
+}
+
bool FakeProxy::commitRequested() const
{
return false;
@@ -43,7 +48,12 @@ bool FakeProxy::commitRequested() const
size_t FakeProxy::maxPartialTextureUpdates() const
{
- return 0;
+ return m_maxPartialTextureUpdates;
+}
+
+void FakeProxy::setMaxPartialTextureUpdates(size_t max)
+{
+ m_maxPartialTextureUpdates = max;
}
diff --git a/cc/test/fake_proxy.h b/cc/test/fake_proxy.h
index fdbc43d..3bbacb5 100644
--- a/cc/test/fake_proxy.h
+++ b/cc/test/fake_proxy.h
@@ -39,8 +39,12 @@ public:
virtual void acquireLayerTextures() OVERRIDE { }
virtual void loseContext() OVERRIDE { }
+ virtual RendererCapabilities& rendererCapabilities();
+ void setMaxPartialTextureUpdates(size_t);
+
private:
RendererCapabilities m_capabilities;
+ size_t m_maxPartialTextureUpdates;
};
} // namespace cc