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

Issue 2017933002: Revert of Add drawer with state information (Closed)

Created:
4 years, 6 months ago by kjlubick
Modified:
4 years, 6 months ago
CC:
reviews_skia.org
Base URL:
https://skia.googlesource.com/skia.git@master
Target Ref:
refs/heads/master
Project:
skia
Visibility:
Public.

Description

Revert of Add drawer with state information (patchset #8 id:140001 of https://codereview.chromium.org/2004633002/ ) Reason for revert: Broke Build-Ubuntu-GCC-Arm7-Debug-Android_Vulkan. See https://uberchromegw.corp.google.com/i/client.skia.compile/builders/Build-Ubuntu-GCC-Arm7-Debug-Android_Vulkan/builds/134/steps/compile_skia%20on%20Ubuntu/logs/stdio Original issue's description: > Now we can use drawer to view the state information of the native app, and set its state using the spinner. > > BUG=skia: > GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2004633002 > > Committed: https://skia.googlesource.com/skia/+/4e4e30823fba0047b93a56bfcf05c04ca57e82ec TBR=djsollen@google.com,jvanverth@google.com,liyuqian@google.com # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia:

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+23 lines, -399 lines) Patch
M platform_tools/android/apps/viewer/build.gradle View 1 chunk +1 line, -7 lines 0 comments Download
D platform_tools/android/apps/viewer/src/main/java/org/skia/viewer/StateAdapter.java View 1 chunk +0 lines, -114 lines 0 comments Download
M platform_tools/android/apps/viewer/src/main/java/org/skia/viewer/ViewerActivity.java View 6 chunks +4 lines, -50 lines 0 comments Download
M platform_tools/android/apps/viewer/src/main/java/org/skia/viewer/ViewerApplication.java View 2 chunks +3 lines, -28 lines 0 comments Download
M platform_tools/android/apps/viewer/src/main/res/layout/activity_main.xml View 1 chunk +12 lines, -31 lines 0 comments Download
D platform_tools/android/apps/viewer/src/main/res/layout/state_item.xml View 1 chunk +0 lines, -35 lines 0 comments Download
D platform_tools/android/apps/viewer/src/main/res/values/strings.xml View 1 chunk +0 lines, -5 lines 0 comments Download
M tools/viewer/Viewer.h View 1 chunk +0 lines, -3 lines 0 comments Download
M tools/viewer/Viewer.cpp View 6 chunks +0 lines, -64 lines 0 comments Download
M tools/viewer/sk_app/Window.h View 5 chunks +0 lines, -13 lines 0 comments Download
M tools/viewer/sk_app/Window.cpp View 2 chunks +0 lines, -8 lines 0 comments Download
M tools/viewer/sk_app/android/Window_android.h View 1 chunk +0 lines, -1 line 0 comments Download
M tools/viewer/sk_app/android/Window_android.cpp View 1 chunk +0 lines, -4 lines 0 comments Download
M tools/viewer/sk_app/android/surface_glue_android.h View 5 chunks +3 lines, -10 lines 0 comments Download
M tools/viewer/sk_app/android/surface_glue_android.cpp View 4 chunks +0 lines, -26 lines 0 comments Download

Messages

Total messages: 4 (1 generated)
kjlubick
Created Revert of Add drawer with state information
4 years, 6 months ago (2016-05-27 13:12:18 UTC) #1
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2017933002/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/2017933002/1
4 years, 6 months ago (2016-05-27 13:12:25 UTC) #2
commit-bot: I haz the power
4 years, 6 months ago (2016-05-27 13:12:33 UTC) #4
Failed to apply patch for tools/viewer/Viewer.cpp:
While running git apply --index -3 -p1;
  error: patch failed: tools/viewer/Viewer.cpp:33
  Falling back to three-way merge...
  Applied patch to 'tools/viewer/Viewer.cpp' with conflicts.
  U tools/viewer/Viewer.cpp

Patch:       tools/viewer/Viewer.cpp
Index: tools/viewer/Viewer.cpp
diff --git a/tools/viewer/Viewer.cpp b/tools/viewer/Viewer.cpp
index
6519a3c8be59007e89ee882c6739638fa61a8291..c4b8b26dc51e3fda5a43a66962f5dba0a397de0d
100644
--- a/tools/viewer/Viewer.cpp
+++ b/tools/viewer/Viewer.cpp
@@ -33,12 +33,6 @@
     Viewer* viewer = reinterpret_cast<Viewer*>(userData);
 
     return viewer->onTouch(owner, state, x, y);
-}
-
-static void on_ui_state_changed_handler(const SkString& stateName, const
SkString& stateValue, void* userData) {
-    Viewer* viewer = reinterpret_cast<Viewer*>(userData);
-
-    return viewer->onUIStateChanged(stateName, stateValue);
 }
 
 DEFINE_bool2(fullscreen, f, true, "Run fullscreen.");
@@ -59,12 +53,6 @@
     " [Vulkan]"
 };
 
-const char* kName = "name";
-const char* kValue = "value";
-const char* kOptions = "options";
-const char* kSlideStateName = "Slide";
-const char* kBackendStateName = "Backend";
-
 Viewer::Viewer(int argc, char** argv, void* platformData)
     : fCurrentMeasurement(0)
     , fDisplayStats(false)
@@ -91,7 +79,6 @@
     fCommands.attach(fWindow);
     fWindow->registerPaintFunc(on_paint_handler, this);
     fWindow->registerTouchFunc(on_touch_handler, this);
-    fWindow->registerUIStateChangedFunc(on_ui_state_changed_handler, this);
 
     // add key-bindings
     fCommands.addCommand('s', "Overlays", "Toggle stats display", [this]() {
@@ -226,10 +213,6 @@
 }
 
 void Viewer::setupCurrentSlide(int previousSlide) {
-    if (fCurrentSlide == previousSlide) {
-        return; // no change; do nothing
-    }
-
     fGesture.reset();
     fDefaultMatrix.reset();
     fDefaultMatrixInv.reset();
@@ -252,7 +235,6 @@
     }
 
     this->updateTitle();
-    this->updateUIState();
     fSlides[fCurrentSlide]->load();
     if (previousSlide >= 0) {
         fSlides[previousSlide]->unload();
@@ -400,49 +382,3 @@
         fWindow->inval();
     }
 }
-
-void Viewer::updateUIState() {
-    Json::Value slideState(Json::objectValue);
-    slideState[kName] = kSlideStateName;
-    slideState[kValue] = fSlides[fCurrentSlide]->getName().c_str();
-    Json::Value allSlideNames(Json::arrayValue);
-    for(auto slide : fSlides) {
-        allSlideNames.append(Json::Value(slide->getName().c_str()));
-    }
-    slideState[kOptions] = allSlideNames;
-
-    // This state is currently a demo for the one without options.
-    // We will be able to change the backend too.
-    Json::Value backendState(Json::objectValue);
-    backendState[kName] = kBackendStateName;
-    backendState[kValue] = fBackendType == sk_app::Window::kVulkan_BackendType
?
-            "Vulkan" : "Other than Vulkan";
-    backendState[kOptions] = Json::Value(Json::arrayValue);
-
-    Json::Value state(Json::arrayValue);
-    state.append(slideState);
-    state.append(backendState);
-
-    fWindow->setUIState(state);
-}
-
-void Viewer::onUIStateChanged(const SkString& stateName, const SkString&
stateValue) {
-    // Currently, we only recognize the Slide state
-    if (stateName.equals(kSlideStateName)) {
-        int previousSlide = fCurrentSlide;
-        fCurrentSlide = 0;
-        for(auto slide : fSlides) {
-            if (slide->getName().equals(stateValue)) {
-                setupCurrentSlide(previousSlide);
-                break;
-            }
-            fCurrentSlide++;
-        }
-        if (fCurrentSlide >= fSlides.count()) {
-            fCurrentSlide = previousSlide;
-            SkDebugf("Slide not found: %s", stateValue.c_str());
-        }
-    } else {
-        SkDebugf("Unknown stateName: %s", stateName.c_str());
-    }
-}

Powered by Google App Engine
This is Rietveld 408576698