| Index: chrome/browser/resources/vr_shell/vr_shell_ui_api.js
|
| diff --git a/chrome/browser/resources/vr_shell/vr_shell_ui_api.js b/chrome/browser/resources/vr_shell/vr_shell_ui_api.js
|
| index bc1709cd4bd3ff9a34600aa25d5b4e42db934e23..e7c28ab1b6b31f095b0650696df2904e6257f00e 100644
|
| --- a/chrome/browser/resources/vr_shell/vr_shell_ui_api.js
|
| +++ b/chrome/browser/resources/vr_shell/vr_shell_ui_api.js
|
| @@ -105,6 +105,44 @@ api.setUiCssSize = function(width, height, dpr) {
|
| chrome.send('setUiCssSize', [width, height, dpr]);
|
| };
|
|
|
| +api.FillType = {
|
| + 'NONE': 0,
|
| + 'SPRITE': 1,
|
| + 'OPAQUE_GRADIENT': 2,
|
| + 'GRID_GRADIENT': 3
|
| +};
|
| +
|
| +api.Fill = class {
|
| + constructor(type) {
|
| + this.properties = {};
|
| + this.properties['fillType'] = type;
|
| + }
|
| +}
|
| +
|
| +api.Sprite = class extends api.Fill {
|
| + constructor(pixelX, pixelY, pixelWidth, pixelHeight) {
|
| + super(api.FillType.SPRITE);
|
| + this.properties.copyRect = {x: pixelX, y: pixelY, width: pixelWidth, height: pixelHeight};
|
| + }
|
| +}
|
| +
|
| +api.OpaqueGradient = class extends api.Fill {
|
| + constructor(edgeColor, centerColor) {
|
| + super(api.FillType.OPAQUE_GRADIENT);
|
| + this.properties.edgeColor = edgeColor;
|
| + this.properties.centerColor = centerColor;
|
| + }
|
| +}
|
| +
|
| +api.GridGradient = class extends api.Fill {
|
| + constructor(edgeColor, centerColor, tileNumber) {
|
| + super(api.FillType.GRID_GRADIENT);
|
| + this.properties.edgeColor = edgeColor;
|
| + this.properties.centerColor = centerColor;
|
| + this.properties.tileNumber = tileNumber;
|
| + }
|
| +}
|
| +
|
| /**
|
| * Represents updates to UI element properties. Any properties set on this
|
| * object are relayed to an underlying native element via scene command.
|
| @@ -231,6 +269,10 @@ api.UiElementUpdate = class {
|
| setOpacity(opacity) {
|
| this.properties['opacity'] = opacity;
|
| }
|
| +
|
| + setFill(fill) {
|
| + Object.assign(this.properties, fill.properties);
|
| + }
|
| };
|
|
|
| /**
|
| @@ -251,10 +293,8 @@ api.UiElement = class extends api.UiElementUpdate {
|
| */
|
| constructor(pixelX, pixelY, pixelWidth, pixelHeight) {
|
| super();
|
| -
|
| - /** @private {Object} */
|
| - this.properties['copyRect'] =
|
| - {x: pixelX, y: pixelY, width: pixelWidth, height: pixelHeight};
|
| +
|
| + this.setFill(new api.Sprite(pixelX, pixelY, pixelWidth, pixelHeight));
|
| }
|
| };
|
|
|
|
|