shadow$provide.module$node_modules$pixi_DOT_js$lib$scene$sprite_nine_slice$NineSliceSpritePipe = function(global, require, module, exports) {
  global = require("module$node_modules$pixi_DOT_js$lib$extensions$Extensions");
  var GCManagedHash = require("module$node_modules$pixi_DOT_js$lib$utils$data$GCManagedHash");
  module = require("module$node_modules$pixi_DOT_js$lib$scene$mesh$shared$BatchableMesh");
  var NineSliceGeometry = require("module$node_modules$pixi_DOT_js$lib$scene$sprite_nine_slice$NineSliceGeometry");
  "use strict";
  class NineSliceSpriteGpuData extends module.BatchableMesh {
    constructor() {
      super();
      this.geometry = new NineSliceGeometry.NineSliceGeometry();
    }
    destroy() {
      this.geometry.destroy();
    }
  }
  class NineSliceSpritePipe {
    constructor(renderer) {
      this._renderer = renderer;
      this._managedSprites = new GCManagedHash.GCManagedHash({renderer, type:"renderable", name:"nineSliceSprite"});
    }
    addRenderable(sprite, instructionSet) {
      const gpuSprite = this._getGpuSprite(sprite);
      sprite.didViewUpdate && this._updateBatchableSprite(sprite, gpuSprite);
      this._renderer.renderPipes.batch.addToBatch(gpuSprite, instructionSet);
    }
    updateRenderable(sprite) {
      const gpuSprite = this._getGpuSprite(sprite);
      sprite.didViewUpdate && this._updateBatchableSprite(sprite, gpuSprite);
      gpuSprite._batcher.updateElement(gpuSprite);
    }
    validateRenderable(sprite) {
      const gpuSprite = this._getGpuSprite(sprite);
      return !gpuSprite._batcher.checkAndUpdateTexture(gpuSprite, sprite._texture);
    }
    _updateBatchableSprite(sprite, batchableSprite) {
      batchableSprite.geometry.update(sprite);
      batchableSprite.setTexture(sprite._texture);
    }
    _getGpuSprite(sprite) {
      return sprite._gpuData[this._renderer.uid] || this._initGPUSprite(sprite);
    }
    _initGPUSprite(sprite) {
      const gpuData = sprite._gpuData[this._renderer.uid] = new NineSliceSpriteGpuData();
      gpuData.renderable = sprite;
      gpuData.transform = sprite.groupTransform;
      gpuData.texture = sprite._texture;
      gpuData.roundPixels = this._renderer._roundPixels | sprite._roundPixels;
      this._managedSprites.add(sprite);
      sprite.didViewUpdate || this._updateBatchableSprite(sprite, gpuData);
      return gpuData;
    }
    destroy() {
      this._managedSprites.destroy();
      this._renderer = null;
    }
  }
  NineSliceSpritePipe.extension = {type:[global.ExtensionType.WebGLPipes, global.ExtensionType.WebGPUPipes], name:"nineSliceSprite"};
  exports.NineSliceSpriteGpuData = NineSliceSpriteGpuData;
  exports.NineSliceSpritePipe = NineSliceSpritePipe;
};

//# sourceMappingURL=module$node_modules$pixi_DOT_js$lib$scene$sprite_nine_slice$NineSliceSpritePipe.js.map
