summaryrefslogtreecommitdiffstats
path: root/o3d/plugin
diff options
context:
space:
mode:
authormilligan@google.com <milligan@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-07 20:57:35 +0000
committermilligan@google.com <milligan@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-07 20:57:35 +0000
commita218b1cf39da7ac9b7cd2467c775f3ed6d4771e3 (patch)
treed92c556ba853c0a59742b4d90f558fd54a6a0024 /o3d/plugin
parent79034696a6c89c3f6dcfd8f0b37965e402fd8b10 (diff)
downloadchromium_src-a218b1cf39da7ac9b7cd2467c775f3ed6d4771e3.zip
chromium_src-a218b1cf39da7ac9b7cd2467c775f3ed6d4771e3.tar.gz
chromium_src-a218b1cf39da7ac9b7cd2467c775f3ed6d4771e3.tar.bz2
When auto fall-back is enabled, fall back to o2d
if we detect a software renderer is being reported by o3d. Also add software renderer detection to o2d keyed off of the GL_RENDERER string "Software Rasterizer" Review URL: http://codereview.chromium.org/6592020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@77177 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d/plugin')
-rw-r--r--o3d/plugin/cross/o3d_glue.cc23
-rw-r--r--o3d/plugin/idl/idl.gyp12
2 files changed, 17 insertions, 18 deletions
diff --git a/o3d/plugin/cross/o3d_glue.cc b/o3d/plugin/cross/o3d_glue.cc
index ea64a84..b5d2d58 100644
--- a/o3d/plugin/cross/o3d_glue.cc
+++ b/o3d/plugin/cross/o3d_glue.cc
@@ -257,12 +257,13 @@ void PluginObject::TearDown() {
}
void PluginObject::CreateRenderer(const o3d::DisplayWindow& display_window) {
+ bool software_renderer = false;
// In case CreateRenderer is called more than once, reset to the
// uninitialized state..
DeleteRenderer();
renderer_init_status_ = o3d::Renderer::UNINITIALIZED;
- if (features_->render_modes() != Renderer::RENDER_MODE_2D) {
+ if (features_->render_mode() != Renderer::RENDER_MODE_2D) {
if (!o3d::CheckConfig(npp_)) {
renderer_init_status_ = o3d::Renderer::GPU_NOT_UP_TO_SPEC;
} else {
@@ -273,17 +274,24 @@ void PluginObject::CreateRenderer(const o3d::DisplayWindow& display_window) {
renderer_init_status_ = renderer_->Init(display_window, false);
if (renderer_init_status_ != o3d::Renderer::SUCCESS) {
DeleteRenderer();
+ } else {
+ ClientInfoManager* client_info_manager =
+ service_locator()->GetService<ClientInfoManager>();
+ software_renderer =
+ client_info_manager->client_info().software_renderer();
}
}
-#if !defined(SUPPORT_CAIRO)
- } else {
- // The caller requested 2D only mode, but this platform does not support 2d
- renderer_init_status_ = o3d::Renderer::INITIALIZATION_ERROR;
}
-#else
+ if (software_renderer &&
+ (features_->render_mode() == Renderer::RENDER_MODE_AUTO)) {
+ // If the client is OK with 2d mode, we prefer to use cairo instead of a
+ // software renderer. We don't need the 3D renderer we just created.
+ DeleteRenderer();
+ renderer_init_status_ = o3d::Renderer::GPU_NOT_UP_TO_SPEC;
+ DLOG(INFO) << "Software renderer detected. Falling back to o2d.";
}
if ((renderer_init_status_ != o3d::Renderer::SUCCESS) &&
- (features_->render_modes() != Renderer::RENDER_MODE_3D)) {
+ (features_->render_mode() != Renderer::RENDER_MODE_3D)) {
// Attempt to fall back to o2d renderer
renderer_ = o3d::Renderer::Create2DRenderer(&service_locator_);
if (renderer_) {
@@ -297,7 +305,6 @@ void PluginObject::CreateRenderer(const o3d::DisplayWindow& display_window) {
}
}
}
-#endif
}
void PluginObject::DeleteRenderer() {
diff --git a/o3d/plugin/idl/idl.gyp b/o3d/plugin/idl/idl.gyp
index c70dbad..81ead55 100644
--- a/o3d/plugin/idl/idl.gyp
+++ b/o3d/plugin/idl/idl.gyp
@@ -12,16 +12,8 @@
'static_glue_dir': '../../../<(nixysadir)/static_glue/npapi',
'idl_files': [
'<!@(python get_idl_files.py)',
- ],
- 'conditions': [
- ['support_cairo == 1',
- {
- 'idl_files': [
- 'layer.idl',
- 'pattern.idl',
- ],
- },
- ],
+ 'layer.idl',
+ 'pattern.idl',
],
},
'target_defaults': {