| Index: nacl/src/nacl_debugger.cpp
|
| ===================================================================
|
| --- nacl/src/nacl_debugger.cpp (revision 8014)
|
| +++ nacl/src/nacl_debugger.cpp (working copy)
|
| @@ -1,6 +1,11 @@
|
| -#include <cstdio>
|
| -#include <string>
|
|
|
| +/*
|
| + * Copyright 2013 Google Inc.
|
| + *
|
| + * Use of this source code is governed by a BSD-style license that can be
|
| + * found in the LICENSE file.
|
| + */
|
| +
|
| #include "ppapi/cpp/completion_callback.h"
|
| #include "ppapi/cpp/graphics_2d.h"
|
| #include "ppapi/cpp/image_data.h"
|
| @@ -31,13 +36,11 @@
|
| public:
|
| explicit SkiaInstance(PP_Instance instance)
|
| : pp::Instance(instance)
|
| - , fBitmap()
|
| , fCanvas(NULL)
|
| - , fDebugger()
|
| - , fImage()
|
| + , fPicture(NULL)
|
| , fFlushLoopRunning(false)
|
| , fFlushPending(false)
|
| - , fPicture(NULL)
|
| +
|
| {
|
| gPluginInstance = this;
|
| SkGraphics::Init();
|
| @@ -71,13 +74,24 @@
|
| return;
|
| }
|
| fDebugger.loadPicture(fPicture);
|
| +
|
| + // Set up the command list.
|
| SkTArray<SkString>* commands = fDebugger.getDrawCommandsAsStrings();
|
| PostMessage("ClearCommands");
|
| for (int i = 0; i < commands->count(); ++i) {
|
| - SkString message("AddCommand:");
|
| - message.append((*commands)[i]);
|
| - PostMessage(message.c_str());
|
| + SkString addCommand("AddCommand:");
|
| + addCommand.append((*commands)[i]);
|
| + PostMessage(addCommand.c_str());
|
| }
|
| + PostMessage("UpdateCommands");
|
| +
|
| + // Set the overview text.
|
| + SkString overviewText;
|
| + fDebugger.getOverviewText(NULL, 0.0, &overviewText);
|
| + overviewText.prepend("SetOverview:");
|
| + PostMessage(overviewText.c_str());
|
| +
|
| + // Draw the SKP.
|
| if (!fFlushLoopRunning) {
|
| Paint();
|
| }
|
|
|