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

Unified Diff: debugger/res/imp/app.html

Issue 1900233002: Adding checkbox for sRGB SkColor flag (Closed) Base URL: https://skia.googlesource.com/buildbot@master
Patch Set: Created 4 years, 8 months 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: debugger/res/imp/app.html
diff --git a/debugger/res/imp/app.html b/debugger/res/imp/app.html
index 407c04f6ce51062b34f0cb37705279e11a102326..47a0abee6dfdeb01d58a950dd10f01349ae743bd 100644
--- a/debugger/res/imp/app.html
+++ b/debugger/res/imp/app.html
@@ -101,6 +101,7 @@ The main application element for the Skia Debugger.
}
dbg-info-sk,
+ #srgbMode,
#clip {
margin-left: 3em;
margin-bottom: 1em;
@@ -197,6 +198,7 @@ The main application element for the Skia Debugger.
<paper-radio-button name="1">sRGB 32-bit</paper-radio-button>
<paper-radio-button name="2">Linear half-precision float</paper-radio-button>
</paper-radio-group>
+ <paper-checkbox id=srgbMode checked="{{_isTrue(_cmd.srgbMode)}}" on-tap="_srgbMode">Treat SkColor as sRGB</paper-checkbox>
</details-sk>
<details-sk open>
<summary-sk>
@@ -399,6 +401,24 @@ The main application element for the Skia Debugger.
}.bind(this));
},
+ _srgbMode: function(e) {
+ // Ignore if this._cmd hasn't been loaded yet.
+ if (!this._cmd) {
+ return
+ }
+ // Don't do anything if the toggle and the mode already agree.
+ if (this.$.srgbMode.checked === this._cmd.srgbMode) {
+ return
+ }
+ sk.post("/srgbMode/" + (this.$.srgbMode.checked ? 1 : 0), "").then(function() {
+ // Reloads the image and the JSON for all the commands.
+ this._refreshPage();
+ }.bind(this)).catch(function(err) {
+ this.$.srgbMode.checked = !this.$.srgbMode.checked;
+ sk.errorMessage(err);
+ }.bind(this));
+ },
+
_gpuChange: function(e) {
// Ignore if this._cmd hasn't been loaded yet.
if (!this._cmd) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698