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

Unified Diff: plugin/cross/o3d_glue.cc

Issue 6538102: Add support for runtime fall-back from o3d to o2d. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/o3d/
Patch Set: '' Created 9 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/cross/renderer.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: plugin/cross/o3d_glue.cc
===================================================================
--- plugin/cross/o3d_glue.cc (revision 75475)
+++ plugin/cross/o3d_glue.cc (working copy)
@@ -257,6 +257,7 @@
}
void PluginObject::CreateRenderer(const o3d::DisplayWindow& display_window) {
+#if !defined(FORCE_CAIRO)
if (!o3d::CheckConfig(npp_)) {
renderer_init_status_ = o3d::Renderer::GPU_NOT_UP_TO_SPEC;
} else {
@@ -269,6 +270,27 @@
DeleteRenderer();
}
}
+#else
+ // To force cairo, pretend all previous renderer initialization has failed.
Tristan Schmelcher 2 2011/02/23 19:27:30 You shouldn't need this, because renderer_init_sta
+ renderer_init_status_ = o3d::Renderer::GPU_NOT_UP_TO_SPEC;
+#endif
+
+#if defined(SUPPORT_CAIRO)
+ if (renderer_init_status_ != o3d::Renderer::SUCCESS) {
+ // Attempt to fall back to o2d renderer
+ renderer_ = o3d::Renderer::Create2DRenderer(&service_locator_);
+ if (renderer_) {
+ if (renderer_->Init(display_window, false) != o3d::Renderer::SUCCESS) {
Tristan Schmelcher 2 2011/02/23 19:27:30 I think we might as well just assign this result d
+ DeleteRenderer();
+ } else {
+ renderer_init_status_ = o3d::Renderer::SUCCESS;
+ ClientInfoManager* client_info_manager =
+ service_locator()->GetService<ClientInfoManager>();
+ client_info_manager->SetRender2d(true);
+ }
+ }
+ }
+#endif
}
void PluginObject::DeleteRenderer() {
« no previous file with comments | « core/cross/renderer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698