<commit_before>/*
 * Copyright 2015 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 *
 */

#include "VisualBench.h"

#include "GrContext.h"
#include "ProcStats.h"
#include "SkApplication.h"
#include "SkCanvas.h"
#include "SkCommandLineFlags.h"
#include "SkGraphics.h"
#include "SkGr.h"
#include "SkOSFile.h"
#include "SkStream.h"
#include "Stats.h"
#include "VisualLightweightBenchModule.h"
#include "VisualInteractiveModule.h"
#include "gl/GrGLInterface.h"

DEFINE_bool2(fullscreen, f, true, "Run fullscreen.");
DEFINE_bool2(interactive, n, false, "Run in interactive mode.");
DEFINE_bool2(dif, d, false, "Use device-independent fonts.");

VisualBench::VisualBench(void* hwnd, int argc, char** argv)
    : INHERITED(hwnd) {
    SkCommandLineFlags::Parse(argc, argv);

    SkDebugf("Command line arguments:");
    for (int i = 0; i < argc; ++i) {
        SkDebugf("%s\n", argv[i]);
    }

    // these have to happen after commandline parsing
    if (FLAGS_dif) {
        const SkSurfaceProps& props(INHERITED::getSurfaceProps());
        uint32_t flags = SkSurfaceProps::kUseDeviceIndependentFonts_Flag | props.flags();
        INHERITED::setSurfaceProps(SkSurfaceProps(flags, props.pixelGeometry()));
    }
    fModule.reset(new VisualLightweightBenchModule(this));
    if (FLAGS_interactive) {
        fModule.reset(new VisualInteractiveModule(this));
    }
<commit_msg>Move command line print above parse in VisualBench<commit_after>/*
 * Copyright 2015 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 *
 */

#include "VisualBench.h"

#include "GrContext.h"
#include "ProcStats.h"
#include "SkApplication.h"
#include "SkCanvas.h"
#include "SkCommandLineFlags.h"
#include "SkGraphics.h"
#include "SkGr.h"
#include "SkOSFile.h"
#include "SkStream.h"
#include "Stats.h"
#include "VisualLightweightBenchModule.h"
#include "VisualInteractiveModule.h"
#include "gl/GrGLInterface.h"

DEFINE_bool2(fullscreen, f, true, "Run fullscreen.");
DEFINE_bool2(interactive, n, false, "Run in interactive mode.");
DEFINE_bool2(dif, d, false, "Use device-independent fonts.");

VisualBench::VisualBench(void* hwnd, int argc, char** argv)
    : INHERITED(hwnd) {
    SkDebugf("Command line arguments:");
    for (int i = 0; i < argc; ++i) {
        SkDebugf("%s\n", argv[i]);
    }

    SkCommandLineFlags::Parse(argc, argv);

    // these have to happen after commandline parsing
    if (FLAGS_dif) {
        const SkSurfaceProps& props(INHERITED::getSurfaceProps());
        uint32_t flags = SkSurfaceProps::kUseDeviceIndependentFonts_Flag | props.flags();
        INHERITED::setSurfaceProps(SkSurfaceProps(flags, props.pixelGeometry()));
    }
    fModule.reset(new VisualLightweightBenchModule(this));
    if (FLAGS_interactive) {
        fModule.reset(new VisualInteractiveModule(this));
    }

{'fraction_non_alphanumeric': 0.1325589340621797, 'fraction_numerical': 0.006832934745473181, 'mean_word_length': 4.524528301886792, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '649463', 'n_tokens_mistral': 988, 'n_tokens_neox': 957, 'n_words': 237}