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

Unified Diff: sky/viewer/viewer.cc

Issue 797063002: Make reftests work for sky. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: address review comments Created 6 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 | « sky/viewer/internals.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/viewer/viewer.cc
diff --git a/sky/viewer/viewer.cc b/sky/viewer/viewer.cc
index eb5b6d0fba31b3bb14f243cf89fbfd4146359401..4c5dd74eb292dcbce3c546cbebbf0f1e8432948f 100644
--- a/sky/viewer/viewer.cc
+++ b/sky/viewer/viewer.cc
@@ -13,6 +13,8 @@
#include "mojo/public/cpp/application/application_impl.h"
#include "mojo/public/cpp/application/interface_factory_impl.h"
#include "mojo/services/content_handler/public/interfaces/content_handler.mojom.h"
+#include "sky/compositor/display_delegate_bitmap.h"
+#include "sky/compositor/display_delegate_ganesh.h"
#include "sky/engine/public/web/Sky.h"
#include "sky/viewer/content_handler_impl.h"
#include "sky/viewer/document_view.h"
@@ -24,6 +26,9 @@
namespace sky {
+// Load the viewer in testing mode so we can dump pixels.
+const char kTesting[] = "--testing";
+
class Viewer : public mojo::ApplicationDelegate,
public mojo::InterfaceFactory<mojo::ContentHandler> {
public:
@@ -34,6 +39,14 @@ class Viewer : public mojo::ApplicationDelegate,
private:
// Overridden from ApplicationDelegate:
virtual void Initialize(mojo::ApplicationImpl* app) override {
+ if (app->HasArg(kTesting)) {
+ DisplayDelegate::setDisplayDelegateCreateFunction(
+ DisplayDelegateBitmap::create);
+ } else {
+ DisplayDelegate::setDisplayDelegateCreateFunction(
+ DisplayDelegateGanesh::create);
+ }
+
platform_impl_.reset(new PlatformImpl(app));
blink::initialize(platform_impl_.get());
base::i18n::InitializeICU();
« no previous file with comments | « sky/viewer/internals.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698