flutter_flutter/viewer/runtime_flags.cc
Adam Barth 407fb582bd Sky should use an SkPicture when drawing
This CL teaches the Sky compositor to record an SkPicture instead of just
drawing in immediate mode. Using an SkPicture will let us experiment with
various optimizations in Skia that preprocess the SkPicture before translating
the Skia commands to GL commands.

This CL also refactors the "display delegate" system now that we can hand off
an SkPicture to a rasterization backend. The new design requires fewer
backpointers and removes the static display delegate factory.

R=eseidel@google.com

Review URL: https://codereview.chromium.org/854303002
2015-01-19 18:47:53 -08:00

33 lines
734 B
C++

// Copyright 2015 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 "sky/viewer/runtime_flags.h"
#include "base/logging.h"
#include "mojo/public/cpp/application/application_impl.h"
namespace sky {
namespace {
bool initialized = false;
RuntimeFlags flags;
// Load the viewer in testing mode so we can dump pixels.
const char kTesting[] = "--testing";
} // namespace
void RuntimeFlags::Initialize(mojo::ApplicationImpl* app) {
DCHECK(!initialized);
flags.testing_ = app->HasArg(kTesting);
initialized = true;
}
const RuntimeFlags& RuntimeFlags::Get() {
DCHECK(initialized);
return flags;
}
} // namespace sky