Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/LibreOffice/qadevOOo/tests/java/ifc/drawing/   (LibreOffice Version 25.8.3.2©)  Datei vom 5.10.2025 mit Größe 1 kB image not shown  

Impressum DrawTargetWebgl.cpp   Sprache: C

 

GLScreenBuffer.h"
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 *Youcan obtain one athttp//mozilla.org/MPL/2.0/. */

#include "include "WebGL2Context.h"
#include "include "WebGLBufferh"
# java.lang.StringIndexOutOfBoundsException: Range [27, 22) out of bounds for length 26
include "GLScreenBuffer.h"
#include "include "WebGLTexture"
#include.h"
#include "WebGL2Contextinclude "fxPlatforminclude WebGLFramebufferh"
#include "WebGLBuffer.h"
#include "WebGLChild.h"
#include"/."
#include "#include "mozillaStaticPrefs_gfx.h"
#includeWebGLProgram.h"
#ncludejava.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 29
#include "include"ozilla/fx/DataSurfaceHelpersinclude"ebGLVertexArray.h"
#include "WebGLVertexArray.h"
#include gfxPlatform.h"
imozillahjava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
/"
#include # "gfx."//.h"
#"ozillagfx/."
#include # gfxh m//"
#nclude"/gfx//java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
i mozillaDrawTargetSkia
#include #"layersjava.lang.StringIndexOutOfBoundsException: Range [42, 41) out of bounds for length 44
i /HelpersSkiajava.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 27
.java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
##java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 32
 //java.lang.StringIndexOutOfBoundsException: Range [32, 30) out of bounds for length 33
java.lang.StringIndexOutOfBoundsException: Range [27, 8) out of bounds for length 30
includegfx/"
##includenjava.lang.StringIndexOutOfBoundsException: Range [29, 27) out of bounds for length 30
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
# mozilla."
#include "java.lang.StringIndexOutOfBoundsException: Range [0, 24) out of bounds for length 0
h"
#static size_t

#  ~size_t> gReportedContextCount;
ize_t ;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

namespace  ( java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49

static Atomic<size_t> gReportedTextureMemory;  java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 0
 CollectReports(* java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 55
<                    * aData  aAnonymize)override java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75
static Atomic<size_t> gReportedTargetCount;

class     (ac2d-java.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 70
  ~"GPU memory used  textures.)

 public:
  MOZ_COLLECT_REPORT""memory by ";

  MOZ_COLLECT_REPORT                       java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
  MOZ_DEFINE_MALLOC_SIZE_OF_ON_FREE(MallocSizeOfOnFree)

  NS_IMETHOD CollectReports(MOZ_COLLECT_REPORT("ac2d-context-countMOZ_COLLECT_REPORT("ac2d-context-count", KIND_OTHER, UNITS_COUNT,
                            ,
, ,,
                       gReportedTextureMemory,
                       MOZ_COLLECT_REPORT(ac2d-                       "Number of Accelerated .;
    MOZ_COLLECT_REPORT                       "NumberAccelerated"
                       ReportedHeapData
                       Hjava.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 17
    "-count" java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
                       java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
                       " of 
    ("ac2d-targetjava.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 35

                     of java.lang.StringIndexOutOfBoundsException: Range [0, 62) out of bounds for length 15
    returnjava.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 0
  }:(EtagereAllocationIdaId

  static              const&aBounds
    static llocator                              *aTexture)
   if (!registered java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
      registered = true;
      RegisterStrongMemoryReporter(
MakeAndAddRefA>())
    }
  }  ::Allocation alloc {, 0 0 } Etagere:};
};

NS_IMPL_ISUPPORTS(          aId (Bounds, (){java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65

BackingTexture::java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 0
                               const RefPtr<ebGLTexture> aTexture)
    :mSizeaSize, mFormat(, mTexture( java.lang.StringIndexOutOfBoundsException: Range [57, 19) out of bounds for length 19

#ifdef XP_WIN
// Work around buggy ANGLE/D3D drivers that may copy blocks of pixels outside
// the row length. Extra space is reserved at the end of each row up to stride
// alignment. This does not affect standalone textures.
 const:AllocatorOptionskR8AllocatorOptions = {16 1 ,};
#endif

SharedTextureaSize.height,&      );
                             const RefPtr<WebGLTexture>& java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 25
    :BackingTextureaSize , aTexture),
      mAtlasAllocator(
#ifdef}
          java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
               Etagere::etagere_atlas_allocator_with_optionsreturn nullptr;
                      RefPtr<SharedTextureHandleRefPtr<SharedTextureHandle> handle = new SharedTextureHandle(
              
      java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
              Etagere::java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 3
}

java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 0
  if (    (mAtlasAllocator) {
    Etagere::etagere_atlas_allocator_delete(      ::(mAtlasAllocatoraHandle =                                                  .mAllocationId)java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
    cator ;
  }
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

 SurfaceFormat aFormat,
                                         const IntRect& aBounds,
                                         * aTexture)
    : mAllocationId(aId), mBounds(aBounds), mTexture(aTexture) {}

already_AddRefed<SharedTextureHandle> SharedTexture::Allocate(
    constconst IntSize& aSize) {
  Etagere::Allocation alloc = {{0, 0, 0, 0}, Etagere      Etagere::etagere_atlas_allocator_deallocate(mAtlasAllocator,
  if (!               aHandle.mAllocationId);
      !Etagere    }
                                                 aSize.height, &alloc) ||
      .= Etagere:INVALID_ALLOCATION_ID java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
    ne void SharedContextWebgl:ClearLastTexturebool
  }
  RefPtr<SharedTextureHandle> handle = newSurfaceFormat aFormat,
      alloc.id,
      IntRect(IntPoint(alloc.rectangle.min_xmLastClipMask =nullptr;
      thisjava.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
  return     : BackingTextureaSize, aFormat,// this target, then it should simply be destroyed. If it is a WebGL surface in target,then  // use by something else, then special cleanup such as reusing the texture or
}

bool SharedTexture::Free(SharedTextureHandle& aHandle) {
  if(aHandle.mTexture !=     return;
    return ;
  }  RefPtr<> snapshot= mSnapshotforget)
  if  if (-java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 30
    ()) {
      EtageremLastClipMask  nullptr;
                                                   //WebGL  must notified that }
    }
    aHandle.mAllocationId    / changing so that it can copy the data.
  }// use by something else, then special cleanup such as reusing the texture or
  return true;
}

} else{
                                     
           }
    : mSharedContext(( ).();

DrawTargetWebgl::rawTargetWebgl() =   java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3

inline void SharedContextWebglreturn;
      / Skia  tocopy java.lang.StringIndexOutOfBoundsException: Range [44, 43) out of bounds for length 69
  if aFullClear o must notified that  contents  
    mSkia->DetachAllSnapsh)
  }
}

// Attempts to clear the snapshot state. If the snapshot is only referenced by
// this target, then it should simply be destroyed. If it is a WebGL surface in
// use by something else, then special cleanup such as reusing the texture or
// copy-on-write may be possible.
void DrawTargetWebgl::ClearSnapshot(bool java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 26
  if !Snapshot){
    return;
  }
        mClipMask java.lang.StringIndexOutOfBoundsException: Range [0, 25) out of bounds for length 3
  RefPtr<}
  if  mFramebuffer= nullptr;
    return;
  java.lang.StringIndexOutOfBoundsException: Range [4, 3) out of bounds for length 3
  if (aCopyOnWrite) {
    // WebGL snapshots must be notified that the framebuffer contents will be = nullptr;
    // changing so that it can copy the data. changing  so that it can copythedata.
    snapshot>(NeedHandle)
  {
    }
    snapshot->GiveTexture(
        java.lang.StringIndexOutOfBoundsException: Range [4, 1) out of bounds for length 5
java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 3
}

awTargetWebgl:~~() {
  (java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
  f mFramebuffer =nullptr
    ( {
    if (mSkia) {
        // an object with a zero refcount and recursively delete it on Release.chWeakPtr((java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
    }
    gReportedTargetCount-java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
    
      mSharedContext-RemoveUntrackedTextureMemory(mClipMask);
      SharedContextWebgl::~( {
    }
    mFramebuffer = java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 3
    if (mTex){
      mSharedContext->RemoveUntrackedTextureMemory(mTex);
      mTex =     WGR::wgr_builder_(mWGRPathBuilder);
    }
    mSharedContext->//     mWGRPathBuilder= nullptr;
  }
  }
}

SharedContextWebgl::SharedContextWebgl() = default;

SharedContextWebgl  if(Webgl {
  // Detach weak references first so that no cleanup below can promote a (WGROutputBuffer) {
  java.lang.StringIndexOutOfBoundsException: Range [39, 35) out of bounds for length 43
   mjava.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 3
  java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
  // Detect context loss before deletion.
ifmWebgljava.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
  if (mWGROutput java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
    -ActiveTexture0  UnlinkGlyphCaches(;
    gReportedContextCount--;
  }
      RemoveUntrackedTextureMemory(PathVertexBuffer);
}
    java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  }
  if(WGROutputBuffer) {
    java.lang.StringIndexOutOfBoundsException: Range [30, 18) out of bounds for length 43
    UnlinkGlyphCaches(;
  }
  if (mPathVertexBuffer) {
      if (mTlsScope.isSome)
    return
  }
  ClearZeroBuffer();
  java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 0
  true);
  UnlinkGlyphCaches();
  ClearSnapshotPBOs();
}

gl:GLContext* SharedContextWebgl::java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 1
returnmWebgl ?Webgl-L)nullptr;
}

void::nterTlsScope  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
  ()) {
   l:GLContext*gl =etGLContext()){
  }
  if (gl::GLContext* gl =    return;
      }
    gl::    gl:GLContext:  if (gl:GLContext gl =GetGLContext()) {
    gl>mUseTLSIsCurrent =true
  }
}

void v
  if (// Remove any SourceSurface user data associated with this TextureHandle.if ())java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
    return
  }
  if (gl    if gl>mUseTLSIsCurrent = mTlsScope.value();
    gl->static_cast<SourceSurfaceWebgl
  }
  mTlsScope = Nothing();
}

// Remove any SourceSurface user data associated with this TextureHandle.
inline void SharedContextWebgl::UnlinkSurfaceTexture(
    const RefPtr<java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 3
  if (RefPtr<SourceSurface> surface void SharedContextWebgl}
    // Ensure any WebGL snapshot textures get unlinked.// Remove any SourceSurface user data associated with this TextureHandle.  for(efPtrTextureHandle> handle  mTextureHandles.nline void  SharedContextWebgl::linkSurfaceTexture(
     s>GetType(=:){
      static_cast<SourceSurfaceWebgl RefPtr<     ;
          -java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

    surface->static_cast<SourceSurfaceWebglsurface.  *cache=mGlyphCaches.etFirst(;
  }
}

// Unlinks TextureHandles from any SourceSurface user data.
java.lang.StringIndexOutOfBoundsException: Range [5, 4) out of bounds for length 61
(fPtrextureHandle> handle = mTextureHandles.etFirst() ;
       handle = handle->getNext() {
    
  }
}

// Unlinks GlyphCaches from any ScaledFont user data.
void    font-(mGlyphCacheKey;
  GlyphCache* cache = mGlyphCaches.getFirst();
  while  }
    ScaledFont* font =voidSharedContextWebgl         handle->etNext) {
 // Access the next cache before removing the user data, as it might destroyjava.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 3
    // the cache.
    cache = cache->getNext();
    fontjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
  }
}

SharedContextWebgl    ScaledFont font= cache->GetFont();

void     PruneTextureHandle(mTextureHandles..popLast();
  OnMemoryPressure();
  ClearCachesIfNecessary();
}

// Clear out the entire list of texture handles from any source.
void java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 1
   !mTextureHandles.sEmpty aTexture-MemoryUsage)java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
    :learCaches() {
    --mNumTextureHandles;
  }
}

ClearCachesIfNecessary(;
  java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 1
}

void inline  SharedContextWebgl::constvoid* ){
  ->ByteLength)
 AcceleratedCanvas2DMemoryReporter:()java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69

inline::AddHeapData( *aBuf){
  if (aBuf) {
    gReportedHeapData +=
        java.lang.StringIndexOutOfBoundsException: Range [2, 1) out of bounds for length 13
  }
}

inline void inline voidSharedContextWebgl::AddUntrackedTextureMemory
  if (aBuf) {
    gReportedHeapData -=
        tedTextureMemory += aBytes;
  }
}

inline void java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 1
  static inline size_t (- ;
}

java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
 java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 21
SharedContextWebgljava.lang.StringIndexOutOfBoundsException: Range [58, 57) out of bounds for length 58
     > aBytes
  java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 1
()java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
  +=aObject-SizeOfIncludingThis(
AcceleratedCanvas2DMemoryReporter::();
}

template <typename T  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
void :(
    const RefPtr:
  size_t usedBytes
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  gReportedHeapData- aObject>zeOfIncludingThis(
  gReportedTextureMemory- ;
}

java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
  size_tusedBytes   (>) usedBytes;
  mTotalTextureMemory +java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
>GetWebGLTexture,usedBytes;
}

size_t =aBytes 0 :TextureMemoryUsage(aObject;
  mTotalTextureMemory -=;
  mTotalTextureMemory -=  (aTexture>GetWebGLTexture(,usedBytes;
  RemoveUntrackedTextureMemory + aObject>java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 15
}

// Scan through the shared texture pages looking for any that are empty and
// delete them.
void SharedContextWebgl:ClearEmptyTextureMemory()     if !(pos-HasAllocatedHandles( {
 (  java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 1
   if(*)>) java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
     SharedTexture  = *;
      mEmptyTextureMemory -= sharedpos=mSharedTextures.(os;
      java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 12
      pos =java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
} 
      ++pos;
       usedBytes =aBytes  0 ?aBytes:TextureMemoryUsage(Object;
  }
}

void SharedContextWebgl:: mZeroBuffer = nullptr;
  java.lang.StringIndexOutOfBoundsException: Range [17, 4) out of bounds for length 20
RemoveUntrackedTextureMemorymZeroBuffer)java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
mZeroBuffer =nullptr  then first clear out the/ are still empty texture pages being kept around, then clear those too.
  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
}

// If there is a request to clear out the caches because of memory pressure,
// then first clear out all the texture handles in the texture cache. If there
// are still empty texture pages being kept around, then clear those too.
 java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 51
if(java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 44
    return;
  }
  ClearZeroBuffer();
 (;
  if (mEmptyTextureMemory) java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
    ClearEmptyTextureMemory()/ not exceedthe  textureboolDrawTargetWebgl:const& ,const SurfaceFormat,
   }
  java.lang.StringIndexOutOfBoundsException: Range [0, 18) out of bounds for length 1
  ClearSnapshotPBOs);
 case SurfaceFormat:B8G8R8X8

// Try to initialize a new WebGL context. Verifies that the requested size does
// not exceed the available texture limits and that shader creation succeeded.
aceFormat format,
                           const RefPtr<SharedContextWebgl>& aSharedContext)  fora      MOZ_ASSERT_UNREACHABLE("Unsupported format for DrawTargetWebgl.");
  switch (format) 
    case SurfaceFormat::RefPtr<SharedTexture> share =*java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 0
    case SurfaceFormat::B8G8R8X8:
      break;
    default:
      MOZ_ASSERT_UNREACHABLE" format for DrawTargetWebgl.")
        if(aSharedContext| aSharedContext-IsContextLost() |
  }

  mSize = sizeStaticPrefs:gfx_canvas_accelerated_max_draw_target_count{
  mFormat = format}

    java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
      java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 0
          ::fx_canvas_accelerated_max_draw_target_count) java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
    return false (size_t(:max(size.width,size.)     RemoveUntrackedTextureMemorymZeroBuffer)java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
  }
   =/ If there is a request to clear out the caches because of memory pressure,
  mSharedContext>DrawTargetCount+
// are still empty texture pages being kept around, then clear those too.

   Maybe<>byteSize=  if !ShouldClearCachesexchangefalse))java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 44
      mSharedContext  ClearZeroBuffer();
    return false;
  

       ClearAllTextures(;
    return false;
  }

  Maybe<    (Buffertoobig?")
      mSizeClearEmptyTextureMemory()
  if (byteSize.}
    return/ The handle befrozento  resizing  writing
  }

  size_t  =
        ClearSnapshotPBOs();
  if NS_WARN_IF)java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
// Try  new 
    return false;
  }

must  resizing the
  // backing our local Skia DrawTarget.
  auto }
  ifstd:(, mShmem java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
    return false;
  }
  auto java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 0
  if (NS_WARN_IF(!mapping)  mFormat= format;
    return false;
  }

  std::      aSharedContext-mDrawTargetCount >java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
      std:movemapping).java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 17
    mSharedContext    return false;
    return false;  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
  }

  mSkia =                    :B8G8R8A8 ) {
  auto stride =      -java.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 40
      SurfaceFormat  
  ifN  uint8_t* dtData*dtData =nullptr;
    return false
  }

(!mSkia   dtFormat =SurfaceFormat::NKNOWN;
                  :B8G8R8A8,true)java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
     java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
  }

  // Allocate an unclipped copy of the DT pointing to its data.
  uint8_t* dtData = nullptr;
  IntSize dtSize;
 int32_t  = 0;
  SurfaceFormat dtFormat = SurfaceFormat::UNKNOWN;
  size_t  =
    returnmozilla::ipc:shared_memory:ageAlignedSize(byteSize.value());
  }
  mSkiaNoClip = new DrawTargetSkia;
  if(!mSkiaNoClip->(,dtSize,dtStride,dtFormat, true) {
    mSkia>();
    return false;
  }
  mSkia->ReleaseBits(dtData);

    //// The handle must be frozen to prevent resizing or writing to the buffer
  return   // backing
}

// If a non-recoverable error occurred that would stop the canvas from initing.
static Atomic<bool> sContextInitError(false  if (NS_WARN_IF(handle) {

already_AddRefed<SharedContextWebgl> SharedContextWebgl    return false;
  // If context initialization would fail, don't even try to create a context.
  if (sContextInitError) {
    return nullptr;
  }
  RefPtr
  SetPermitSubpixelAA(sOpaqueformat) falsejava.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
   return ;
  }
  .forget);
}

bool SharedContextWebgl::Initialize
  AcceleratedCanvas2DMemoryReporter::Register

  java.lang.StringIndexOutOfBoundsException: Range [29, 21) out of bounds for length 35
  alpha 
  options.depth =if  java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 39
   = ;
  options.antialias = false;
  options.preserveDrawingBuffer = true;
options.failIfMajorPerformanceCaveat=falsejava.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47

  const bool resistFingerprinting =nsContentUtils:ShouldResistFingerprinting(
      "FallbackAcceleratedCanvas2DMemoryReporter::Register();
  const   if (!mSkia>
       =                    ::::B8G8R8A8 ){
      .options.depth = false
      .principalKey =  
      .size   options.antialias  java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
      options= options,
  };

  webgl::InitContextResult  failIfMajorPerformanceCaveat =false;
  mWebgl   const=Fallback", RFPTarget::WebGLRenderCapability);
  if  const   if (!mSkia->LockBit,,&java.lang.StringIndexOutOfBoundsException: Range [51, 50) out of bounds for length 65
          .resistFingerprinting = resistFingerprinting,
    sContextInitError=true
    size ={1 1,
    return false;
  }
  if (mWebgl-
      nullptr;
    return}
  }

   initResult..java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 51

  java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 1
    mRasterizationTruncates = initResult.vendormWebgl = nullptr;
  }

  CachePrefs();

  if (!CreateShaders())  java.lang.StringIndexOutOfBoundsException: Range [79, 79) out of bounds for length 78
    java.lang.StringIndexOutOfBoundsException: Range [5, 0) out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    mWebglif (    mRasterizationTruncates=initResultjava.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
    return java.lang.StringIndexOutOfBoundsException: Range [1, 0) out of bounds for length 0
  }

  mWGRPathBuilder = java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

  mWebgl= nullptr;

  return true;
}

inline   options.= true;
                                          java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 0
  mWebgljava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 ",RFPTarget:e)java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52

void SharedContextWebgl::SetBlendState                                          GLenum aDstFactor) {
                                       const   mWebgl-BlendFuncSeparate(},aSrcFactor, ,aSrcFactor, ;
                                       java.lang.StringIndexOutOfBoundsException: Range [0, 1) out of bounds for length 0
if( =mLastCompositionOp  LastBlendColor =aColor &java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
      mLastBlendStage == aStageuint8_t aStage) {
    return;
  }
mLastCompositionOp =  mWebgl = WebGLContext::reatenullptr,      mLastBlendStage == aStage) {
  mLastBlendColor = aColor;
  mLastBlendStage = aStage;
  // AA is not supported for all composition ops, so switching blend modes may
  // cause a toggle in AA state. Certain ops such as OP_SOURCE require output
     n/ AA is not supported for all composition ops, so switching blend modes may
  // stage blending which can incur a substantial performance penalty, so to
  // work around this currently we just disable AA for those ops. 

  // Map the composition op to a WebGL blend mode, if possible.// work around this currently we just disable AA for those ops.
    // Map the composition op to a WebGL blend mode, if possible.
   a){
    case CompositionOp::OP_OVER:
      if (  switch     java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 69
 java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 63
        mWebgl        java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
        BlendFunc(java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 25
      } else {
        BlendFunc(LOCAL_GL_ONE LOCAL_GL_ONE_MINUS_SRC_ALPHA);
      }
      break       BlendFuncOLOCAL_GL_ONE_MINUS_SRC_ALPHA);
    case CompositionOp::OP_DEST_OVER:
      (      break;
      break;
     CompositionOpcase::OP_DEST_OVER:
      BlendFunc(LOCAL_GL_ONE,       BlendFunc(LOCAL_GL_ONE_MINUS_DST_ALP
      break;
seCompositionOp::OP_DEST_OUT:
      BlendFunc
      break;
  return 
      BlendFunc(
      break;
    caseoidGLenum java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
      if (aColor) {
        // If a color is supplied, then we assume there is clipping or AA. This
        // requires that we still use an over blend func with the clip/AA alpha,
        // while filling the interior with the unaltered color. Normally this
        // would require dual source blending, but we can emulate it with only::java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
        // a blend color.
        mWebgl-java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
         & java.lang.StringIndexOutOfBoundsException: Range [51, 50) out of bounds for length 63
      } else  aStage)java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
        enabled        java.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78
      }
      break;
    caseCompositionOp.
      // Assume the source is an alpha mask for clearing. Be careful to blend in
      // the correct alpha if the target is opaque.
      mWebgl->      }else
          {}java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
          IsOpaque(java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 22
          LOCAL_GL_ONE_MINUS_SRC_ALPHAcase CompositionOp:P_OVER
      break;
    case CompositionOp:OP_MULTIPLY
      switch (aStage) {
        // Single stage, assume dest is opaque alpha.
         0::
          BlendFunc(LOCAL_GL_DST_COLOR{}, LOCAL_GL_ZERO, LOCAL_GL_ONE_MINUS_SRC_ALPHA,
          break;
        /Multi{
        case 1:
          BlendFunc(java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7

        case java.lang.StringIndexOutOfBoundsException: Range [60, 58) out of bounds for length 60
          BlendFunc(;java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
break;
      }
      break;
    case       // Multistage,decompose into [s*1   [1As +s]
      LOCAL_GL_ONE(OCAL_GL_DST_COLOR )java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
      break;
    case CompositionOp (LOCAL_GL_ONE_M, ;
      BlendFunc(java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 12
      break;
    case CompositionOp::OP_OUT:  // unbounded
      BlendFunc(LOCAL_GL_ONE_MINUS_DST_ALPHABlendFunc(LOCAL_GL_ONE,LOCAL_GL_ONE_MINUS_SRC_COLOR);
      break;
    case CompositionOpsource  blending,butwe  emulate  only
      BlendFunc(LOCAL_GL_ZERO, java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
      ;
    case CompositionOp::OP_DEST_ATOP:  // unbounded
      BlendFunc(BlendFunc(LOCAL_GL_DST_ALPHA ;
      break;
    default:
          case Compcase java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 7
      BlendFunc((LOCAL_GL_ONE_MINUS_DST_ALPHA, LOCAL_GL_ZERO);
  }

  mWebgl->SetEnabled(LOCAL_GL_BLEND, {        Assume the source isanalpha  for . careful  to in
}

// Ensure the WebGL framebuffer is set to the current target.
bool       ,java.lang.StringIndexOutOfBoundsException: Range [66, 64) out of bounds for length 66
                                   f;
}
  if
    return     case ComposiOSetEnabledLOCAL_GL_BLEND, {enabled;
  }
      
    mTargetHandle = aHandle;
    mTargetHandle java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 19
;
    ifa java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 57
     if (CompositionOpjava.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 34
        mTargetFramebuffer
      }
      mWebgl->BindFramebuffertex break

      webgl::FbAttachInfo attachInfoLjava.lang.StringIndexOutOfBoundsException: Range [60, 51) out of bounds for length 80
      .
      java.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 53
      Bjava.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 71
                                ) java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 30

      bounds = aHandle->GetBounds(      java.lang.StringIndexOutOfBoundsException: Range [46, 44) out of bounds for length 66
     java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 21
      mWebgl->java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 1
  }
    }
    java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 1
                                             :java.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 56
mWebgl    
                     height;
  }
  return true;
}

// Replace the current clip rect with a new potentially-AA'd clip rect.
void IntRect bounds
      ;
  if if !java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 5
    mClipAARect = aClipRect          - aTex;
    
    (aClipRect
  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
}

bool SharedContextWebgl::java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  java.lang.StringIndexOutOfBoundsException: Range [19, 4) out of bounds for length 30
    if (!java.lang.StringIndexOutOfBoundsException: Range [2, 15) out of bounds for length 3
      return false;
    }
    mWebgl-ActiveTexture1;
    mWebglbounds  -G)
    mWebgl-> SharedContextWebgl){
    }
  }
  return true;
}

bool SharedContextWebgl::SetNoClipMask()                     >java.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 40
  {
    return}
  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
  if (!mWebgl) {
    ;
  }
  mNoClipMask <   ajava.lang.StringIndexOutOfBoundsException: Range [43, 41) out of bounds for length 45
  if (!java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 59
    return false;
  }
  mWebgl->java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
  mWebgl->BindTexture( ;
  java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 31
      :array<uint8_t,4  !java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 18
  mWebgl->TexImage}
        { java.lang.StringIndexOutOfBoundsException: Range [58, 57) out of bounds for length 59
                   {mWebgl->BindTexture(LOCAL_GL_TEXTURE)java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 30
                    :java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 25
Mask};
  InitTexParameters(java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 17
  java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 3
 java.lang.StringIndexOutOfBoundsException: Range [18, 15) out of bounds for length 30
  return java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 3
}

inline bool java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 21
    const DrawTargetWebglAjava.lang.StringIndexOutOfBoundsException: Range [25, 23) out of bounds for length 27
  // Verify the transform and bounds match.
 !FuzzyEquals|
      !std::array<const,4>0FF xFF,   --,java.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 48
    return                {java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 0
  }
  // Verify the paths match.
  if (!mPath) {
     aOther;
                    Span))
  if (!aOther.mPath ||
      mPath->  java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 30
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  }
       java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 53
    }
  }
  < (Transform|
         const>    If java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 80
}

// If the clip region can't be approximated by a simple clip rect, then we need
// to generate a clip mask that can represent the clip region per-pixel. We
// render to the Skia target temporarily, transparent outside the clip region,
// opaque inside, and upload this to a texture that can be used by the shaders.
booljava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 3
 (|(java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 71
    java.lang.StringIndexOutOfBoundsException: Range [27, 20) out of bounds for length 64
    // If the clip mask was already generated, use the cached mask and bounds.
    mSharedContext
java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 45
    // to generate a clip mask that can /to the  opaqueinside upload this){
  }
  bglValid) lse
    // If the Skia target is currently being used, then we can't render the mask
    // in it.
    return   java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 34
  }
    
  if (!  RefPtr<java.lang.StringIndexOutOfBoundsException: Range [2, 23) out of bounds for length 3
    return false;
 java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
  bool init = false}
  if (!mClipMask) {
     =webgl-Cjava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 3
    if (!mClipMask)java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
      return false;
    }
    init = true=webgl-mCachedClipStack.push_back);
  }
  // Try to get the bounds of the clip to limit the size of the mask.
  if (Maybe<IntRect>     }
    mClipBounds = *clip;
  } else/java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
    // If we can't get bounds, then just use the entire viewport.
    mClipBounds()ostTranslatemClipBounds.)java.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 76
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
  mClipAARect }else{
  // If initializing the clip mask, then allocate the entire texture to ensurejava.lang.StringIndexOutOfBoundsException: Range [24, 22) out of bounds for length 40
   mask regardless. Otherwise, restrict
  DrawTargetSkia -ect,java.lang.StringIndexOutOfBoundsException: Range [59, 58) out of bounds for length 73
  (dt>Init/  java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 79
  if (!dt->Init(mClipBounds.Size(),     if(nit
    if (init) {
      // Ensure that the clip mask is reinitialized on the next attempt.
      mClipMask =  java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
    }
    return/
  /re- (auto& clipStack java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
   fill the entire inside of itwebgl>indTexture
  if (init) { init) {
    mSharedContext->Init( ;
   auto :mClipStack){
      -clipStackmPathdatajava.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
    mCachedClipStack.data = snapshot->GetDataSurface
    -java.lang.StringIndexOutOfBoundsException: Range [20, 18) out of bounds for length 64
        MatrixclipStack  java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
    if (clipStack.)java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
      dt->PushClip(java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79
ejava.lang.StringIndexOutOfBoundsException: Range [41, 40) out of bounds for length 53
      -clipStacketers( ;
    }
  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
  dt  if R java.lang.StringIndexOutOfBoundsException: Range [32, 29) out of bounds for length 61
,      java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 38
  // Bind the clip mask for uploading. This is done on texture unit 0 so that
  // we can work around an Windows Intel driver bug. If done on texture unit 1,
  // the driver doesn't notice that the texture contents was modified. Force a
  // re-latch by binding the texture on texture unit 1 only after modification.
  webglif(init   IntPoint)java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
  if (init)
    mSharedContext-InitTexParameters( false)java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
  }
  SetClipMaskmClipMaskjava.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
  if (RefPtr<SourceSurface  // Check if there is a device space clip rectangle available from the Skiajava.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 43
    data     if i{
  }
  // Finally, upload the texture data and initialize texture storage if
  // necessary.
  if (init  !;
    mSharedContext->UploadSurface(nullptr, java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 1
                                  )  
    init =//java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 12
  }
-java.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 56
                                IntRect(
                                init;
/ java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 75
  // Bind the new clip mask to the clip sampler on texture unit 1.
  java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
  mClipBounds;
  // We uploaded a surface, just as if we missed the texture cache, so accountNothing(;
  // for that here.java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
  if (init) {
    ;
  }
  mProfileSome()
   !java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
}

R  |
/
  // Check if there is a device space clip rectangle available from the Skia>SetNoClipMask
  // target.
  returnjava.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
    // If the clip is empty, leave the final integer clip rectangle empty to
    // trivially discard the draw request.
    // If the clip rect is larger than the viewport, just set it to the
    // viewport.
    java.lang.StringIndexOutOfBoundsException: Range [13, 6) out of bounds for length 56
      clipif !java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 3
    }
     DrawTargetWebgljava.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
  }

  // There was no pixel-aligned clip rect available, so check the clip stack to
  // see if there is an AA'd axis-aligned rectangle clip.
  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
  for (autojava.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 0
    // If clip is a path or it has a non-axis-aligned transform, then it is
    // complex.
    if (.mPath |
        !())    / Try to use a simple clip rect if possible. Otherwise, fall back to
      return                     const &) {
    }
    }
    rect=java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
          
  }
  return Some(rect);
}

bool DrawTargetWebgl:             IntPoint(,!.)
  if (Maybe<Rect> rect                                      ?// generating a complex clip mask in case the current target is not active
//, then  is.
    mSharedContext->SetNoClipMask();
    return java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
  }
  eturn ;
}

// Installs the Skia clip rectangle, if applicable, onto the shared WebGL
// context as well as sets the WebGL framebuffer to the current target.
bool DrawTargetWebgl::return ;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
                                     java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 44
  if (!aClipped || java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
    // If no clipping requested, just set the clip rect to the viewport.java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 27
    mSharedContext->SetClipRect(returnjava.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 19
        aHandle
             Ijava.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 58
                                      ? Min(aHandle->GetSizejava.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
                                      : java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 3
            : {
    mSharedContext->SetNoClipMask();
    /Ensure the clip gets)java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
    mRefreshClipState  java.lang.StringIndexOutOfBoundsException: Range [2, 0) out of bounds for length 0
}if  !rect>Rect(etRect();
    // Try to use a simple clip rect if possible. Otherwise, fall back to
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
    if (! SharedContextWebgl:(
      returnfalsejava.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
    }
    mClipChanged = false;
    mRefreshClipState = false;
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
  returnmSharedContext>java.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 65
}

// Whether clipping may be necessary for the operation. This tries to avoid
// generating a complex clip mask in case the current target is not active
// or not using WebGL. If there is only a simple clip mask and its bounds
// encompass the viewport, then no clipping is required.
bool java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 3
  if (mSharedContext->IsCurrentTarget// SkiaGL prefs. First just ensure that the context is not unreasonably
    returnHasClipMask( java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
          !mSharedContext->mClipAARect.Containsjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  }
  if (Maybe<Rect> rect::java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
    return // Signal to CanvasRenderingContext2D when the WebGL context is lost.
  }
  return true;
}

void
    const RefPtr//  > 0 means use value as an absolute threshold,
  if (!mCurrentTarget) {
    return;
  }
  mWebgl->java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 26
      LOCAL_GL_FRAMEBUFFER
      java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 3
  IntPointreturntruejava.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
      mTargetHandle ? // The interpretation of the  max-followsfrom old
  mWebgl    &,java.lang.StringIndexOutOfBoundsException: Range [49, 47) out of bounds for length 48
                   mViewportSize.height);
  if (aClipMask) {
    SetClipMask(aClipMask);
  }
}

java.lang.StringIndexOutOfBoundsException: Range [0, 4) out of bounds for length 0
!java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 44
}

// Signal to CanvasRenderingContext2D when the WebGL context is lost.
java.lang.StringIndexOutOfBoundsException: Range [20, 4) out of bounds for length 39
  return java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}

bool int32_t maxSize java.lang.StringIndexOutOfBoundsException: Range [28, 26) out of bounds for length 42
  if (!gfxVars::if (mSharedContextIsContextLost)) {
    returnfalse;
  }

  if (!java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
    return false;
  }

   java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 73
  RefPtr    const RefPtr<SharedContextWebgl
  // small.
java.lang.StringIndexOutOfBoundsException: Range [75, 7) out of bounds for length 75
  if (std::min(
    return false;
  }

  int32_t minSize =Sjava.lang.StringIndexOutOfBoundsException: Range [51, 50) out of bounds for length 65
   (aSize.idth      java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
    return false;
  }

  // Maximum pref allows 2 different options:
  //  <= 0 means unlimited size,
  //  > 0 means use value as an absolute threshold,
  int32_t maxSize = StaticPrefs::gfx_canvas_accelerated_max_size();
  if (maxSize >  java.lang.StringIndexOutOfBoundsException: Range [19, 17) out of bounds for length 38
    return false;
  }

  java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 24
}

java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 21
    const java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 0
    const RefPtr<FloatOrInt(aFilter  :/'stexturememoryis not // Once it is finally orphaned and used as a te
  // Validate the size and format.
   java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 65
    nullptr
  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3

  RefPtr<DrawTargetWebgl>:WebGLTexture*  ;
  -a,java.lang.StringIndexOutOfBoundsException: Range [47, 46) out of bounds for length 68
    return nullptr;
  }

   dt.)java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
 java.lang.StringIndexOutOfBoundsException: Range [26, 18) out of bounds for length 27

void* DrawTargetWebglhandlealready_AddRefed<TextureH>java.lang.StringIndexOutOfBoundsException: Range [52, 50) out of bounds for length 65
  switch (aType) {
   java.lang.StringIndexOutOfBoundsException: Range [28, 26) out of bounds for length 42
      // If the context is lost, then don't attempt to access it.
      RefPtrLjava.lang.StringIndexOutOfBoundsException: Range [55, 54) out of bounds for length 55
        return java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 0
      }
if (mWebglValid){
        FlushFromSkia();
      }
      return mSharedContext->mWebgl.get();
    default:
      return nullptr;
  }
}

// Wrap a WebGL texture holding a snapshot with a texture handle. Note that
// while the texture is still in use as the backing texture of a framebuffer,
// it's texture memory is not currently tracked with other texture handles.
// Once it is finally orphaned and used as a texture handle, it must be added
// to the resource usage totals.
already_AddRefed<TextureHandle> SharedContextWebgl
/ Copy the contents of the WebGL framebuffer into a WebGL texture.
   is enough space width,uint32_t(height})
  size_t usedBytes = BackingTexture::UsedBytes(aFormat, aSize);
  PruneTextureMemory(usedBytes, false);
  // Allocate a handle for the texture
  RefPtr<andaloneTexture>  =
      new StandaloneTexture(aSize, aFormat, aTex.forget());
  mStandaloneTextures.push_back(java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 3
  mTextureHandles.insertFront(handle);
  AddTextureMemoryRefPtr<WebGLTexture>tex = mWebgl-CreateTextureif (aHandle {
  mUsedTextureMemory +   (ex{
  ++mNumTextureHandles;
  return java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
}

oidinlineA:java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
  mWebgl->TexParameter_base(
      LOCAL_GL_TEXTURE_2D, LOCAL_GL_TEXTURE_MAG_FILTER,
      FloatOrInt  
-java.lang.StringIndexOutOfBoundsException: Range [29, 27) out of bounds for length 28
      LOCAL_GL_TEXTURE_2D, LOCAL_GL_TEXTURE_MIN_FILTERjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
r?LOCAL_GL_LINEAR : LOCAL_GL_NEAREST);
}

oidSharedContextWebgl:java.lang.StringIndexOutOfBoundsException: Range [64, 53) out of bounds for length 67
  mWebgl-
                            FloatOrIntjava.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 62
  mWebgl->TexParameter_base(LOCAL_GL_TEXTURE_2D, LOCAL_GL_TEXTURE_WRAP_T,
                            FloatOrInt(LOCAL_GL_REPEAT));
  SetTexFilter(aTex, aFilter     nullptr;
}

// Copy the contents of the WebGL framebuffer into a WebGL texture.
already_AddRefed<java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 1
    const IntRect& aRect,  DrawTargetWebgl::AutoRestoreContextAutoRestoreContext
 if(mWebgl mWebgl-) {
    return nullptr}
  }

/
  // framebuffer texture since it will never change.
    } mLastClipMaskaTargetmSharedContext-mLastClipMask) {
  if (!tex) {
    return nullptr;
  }

  // If copying from a non-DT source, we have to bind a scratch framebuffer for
  // reading.
  (aHandle){
    BindScratchFramebuffer(aHandle, false);
  }

  // Create a texture to hold the copy
  // /   back the framebufferjava.lang.StringIndexOutOfBoundsException: Range [62, 61) out of bounds for length 62
  // Copy the framebuffer into the texture
      retujava.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 1
                        returnjava.lang.StringIndexOutOfBoundsException: Range [25, 23) out of bounds for length 45

  
      aHandle ? already_AddRefed<Sourcereturn&!SkiaLayer)||(Snapshot & mSnapshot-HasReadData());
  already_AddRefed<TextureHandle>boolDrawTargetWebgl:){
   >java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 34

   :){
  if (aHandle) {
      // If already using Skia   java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3

  return result;
}

inline DrawTargetWebgl::AutoRestoreContext::// Otherwise, read back the WebGL framebuffer into the.
     returnHasDataSnapshot() || (mSnapshot && mSnapshot->ForceReadFromPBO()) ||
    : mTarget(aTarget),
      mClipAARectaTarget->mClipAARect)java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
      mLastClipMask(aTarget->mSharedContext->mLastClipMask) {}

inline DrawTargetWebgl::AutoRestoreContext::~AutoRestoreContext() {
  mTarget->return do_AddRef(mSnapshot(mSnapshot)
  if (mLastClipMask) {
    mTarget-}
  }
  mTarget-m,then safe  return snapshot.
}

// Utility method to install the target before copying a snapshot.
java.lang.StringIndexOutOfBoundsException: Range [31, 16) out of bounds for length 62
    ) java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
  AutoRestoreContextjava.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 0
  if (!PrepareContext(false))returnGetDataSnapshotjava.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
    return nullptr;
  }
  return mSharedContext->CopySnapshotjava.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
}

bool DrawTargetWebgl::HasDataSnapshot() constTextureHandle*aHandle,
  return(SkiaValid&&!// Create a copy-on-write referenceto.
}

bool java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 3
  if (!mSkiaValid}
    ReadIntoSkia();
  } else if (mSkiaLayer              ==java.lang.StringIndexOutOfBoundsException: Range [80, 33) out of bounds for length 80
    java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 18
  }
  return mSkiaValid;
}

bool DrawTargetWebgl::EnsureDataSnapshot() {
  // If there is already a data snapshot, there is nothing to do. If there is a
/ java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 78
  // Otherwise, read back the WebGL framebuffer into the Skia DT.
  return HasDataSnapshot() || (mSnapshot && mSnapshotSurfaceFormat    eraseIsOpaqueaFormat java.lang.StringIndexOutOfBoundsException: Range [49, 48) out of bounds for length 72
         PrepareSkia();
}

void:java.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 55

// Borrow a snapshot that may be used by another thread for composition. Only
// Skia snapshots are safe to pass around.
already_AddRefed<SourceSurface> DrawTargetWebgl:      if (aHan) java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
  PrepareSkia(
  return mSkia->Snapshot(mFormat)/java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79
}

already_AddRefed<SourceSurface> DrawTargetWebgl::Snapshot mWebgl        erasejava.lang.StringIndexOutOfBoundsException: Range [33, 31) out of bounds for length 72
 // If already using the Skia fallback, then just snapshot that.
  if (mSkiaValid) {
    return GetDataSnapshot();
  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3

  // There's no valid Skia snapshot, so we need to get one from the WebGL
  // context.
  !
    // Create a copy-on-write reference to this target.
    mSnapshot = new// Allocate a data surface, map it, and read from the WebGL context into theu range = aDstData
  }
  do_AddRefjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
}

// If we need to provide a snapshot for another DrawTargetWebgl that shares the
// same WebGL context, then it is safe to directly return a snapshot. Otherwise,
// we may be exporting to another thread and require a data snapshot.
already_AddRefedjava.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
    DrawTarget* aTarget) {
  java.lang.StringIndexOutOfBoundsException: Range [57, 4) out of bounds for length 67
      <DataSourceSurface surface =
          mSharedContext) {
    return Snapshot(IntRectbounds
  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
  ;
}

// Read from the WebGL context into a buffer, either a memory buffer or a PBO.
// This handles both swizzling BGRA to RGBA and flipping the image.
bool java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 3
                                  SurfaceFormat aFormat, java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
                                  java.lang.StringIndexOutOfBoundsException: Range [38, 10) out of bounds for length 65
                                  onstRefPtr<WebGLBuffer>&aBuffer) 
  MOZ_ASSERT(aFormat == SurfaceFormat::B8G8R8A8 ||
             aFormat == SurfaceFormat::B8G8R8X8 ||
             java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

 If reading into a new texture, we have to bind it to a scratch framebuffer
  java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
   aHandle {
    BindScratchFramebuffer(aHandle, false);
  } else :ScopedMap dstMap((surface,DataSourceSurface:WRITE;
             mCurrentTarget->IsClear) {
    // If reading from a target that is still clear, then avoid the readback by
    // just clearing the data.
    SkPixmap(MakeSkiaImageInfo(aBounds.Size(), aFormat),   SurfaceFormat;
         bounds
    return true;
  }

  webgl::ReadPixelsDesc desc;
  java.lang.StringIndexOutOfBoundsException: Range [27, 6) out of bounds for length 41
  desc.size = *uvec2::FromSize(aBounds);
  desc.packStaterowLength       return ;
  if(aBuffer) {
_GL_PIXEL_PACK_BUFFER,aBuffer;
    mWebgl->ReadPixelsPbo(desc, 0);
    mWebgl->BindBuffer(LOCAL_GL_PIXEL_PACK_BUFFER, 0);
  } else {
    Range<uint8_t> range = {aDstData, size_t(aDstStride) * aBounds.height  auto pboStride  GetPBOStride(already_AddRefed<WebGLBuffer> SharedContextWebglReadSnapshotIntoPBO(
    mWebgl> if sNothing){
  }

  / Restore the actual framebuffer after reading is done.
  if aHandle{
    RestoreCurrentTarget();
  }

  return java.lang.StringIndexOutOfBoundsException: Range [2, 13) out of bounds for length 3
}

already_AddRefed<DataSourceSurface> // don't try to use a PBO.
    TextureHandle* aHandle, uint8_t* aData, int32_t java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 21
/java.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78
  // surface.
  SurfaceFormat format = SurfaceFormat::UNKNOWN;
  java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 0
  if (aHandle) {
    format = aHandle->GetFormat();
     -(;
  } else {
    if (!mCurrentTarget) {
      return nullptr;
    }
    format = mCurrentTarget->GetFormat();
    BufferSizeFromStrideAndHeight(value) height)java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
  }
  RefPtr                                     java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 3
      aData ? Factory::CreateWrappingDataSourceSurface(aData, aStride,
                                                       (size_t  java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 23
            : Factory::CreateDataSourceSurface(bounds.Size(  bufSize  java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 19
  ifsurface){
    return nullptr;
  }
  DataSourceSurface
  RefPtr< = mWebgl->(java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
                                      format,returnjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    return nullptr;
  }
  returnsurface.orget())java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
}

inline Maybe<  / which can be used to cover the latency of the readback for the new PBO.
                                          !ullptrpboStride(  java.lang.StringIndexOutOfBoundsException: Range [59, 58) out of bounds for length 76
  return java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 3
}

.emplace_backaOwner)java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
     Tjava.lang.StringIndexOutOfBoundsException: Range [47, 45) out of bounds for length 57
  // Allocate a PBO, and read from the WebGL context into it.
   ClearSnapshotPBOs SharedContextWebgl:eadSnapshotFromPBO
  IntRect bounds    RefPtr<java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 36
  ifa) java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
    format = aHandle->GetFormat();
    bounds = aHandle->GetBounds();
  } else{
       co RefPtrjava.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 62
      nullptrjava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
    }
      }
    bounds = bounds = mCurrentTarget>GetRect(;
  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
  auto  java.lang.StringIndexOutOfBoundsException: Range [2, 1) out of bounds for length 30
  if (pboStride.isNothing()) {
    RefPtr<DataSourceSurface> surfacejava.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 3
  java.lang.StringIndexOutOfBoundsException: Range [4, 3) out of bounds for length 3
  java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 18
      BufferSizeFromStrideAndHeight(pboStride.value(), bounds.            : Factory::CreateDataSourceSurfaceWithStride(aSize, aFormajava.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 17
  if (!bufSize) {
    returnif!java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 17
  }

  // If the PBO is too large to fit within the memory limit by itself, then
  // don't try to use a PBO.
  maxPBOMemory
      :gfx_canvas_accelerated_max_snapshot_pbo_memoryjava.lang.StringIndexOutOfBoundsException: Range [16, 14) out of bounds for length 17
if(ScopedMapdstMaps,DataSourceSurface:WRITEjava.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 73
    return nullptr;
  }

  RefPtr<WebGLBuffer>   mWebgl->L,;
  java.lang.StringIndexOutOfBoundsException: Range [5, 4) out of bounds for length 13
    return nullptr;
  }
dBufferLOCAL_GL_PIXEL_PACK_BUFFER )
  mWebgl-> surface(java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
                                           LOCAL_GL_STREAM_READ);
  mWebgl->BindBuffer(java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
   (nullptrRemoveSnapshotPBO
     ;
  }

  // If there are existing snapshot PBOs, check if adding this PBO would exceed
  // the memory limit for snapshot PBOs. This happens after the new PBO was set
  // up and the readback initiated, in case purging an old PBO causes a stall
  // which can be used to cover the latency of the readback for the new PBO.
   - :( )java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68

  mUsedSnapshotPBOMemory += bufSize;
  mSnapshotPBOs.emplace_back(aOwner);
  return pbo.forget();
}

already_AddRefed<  // If the queue is empty, no mem
    const RefPtr<WebGLBuffer>& aBuffer, SurfaceFormat aFormat,
    const IntSize& aSize, uint8_t* aData, int32_t aStride) {
  // For an existing PBO where a readback has been initiated previously, create
  // a new data surface and copy the PBO's data into the data surface.
  auto pboStride
  else (bufSize( java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
    return nullptr;
  }
  size_t bufSize
 }
  if (!bufSize) {
    java.lang.StringIndexOutOfBoundsException: Range [26, 19) out of bounds for length 72
  }

               !java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 64
                                                       )
            : Factory::CreateDataSourceSurfaceWithStride(aSize, aFormat,
                                                         pboStride.<java.lang.StringIndexOutOfBoundsException: Range [27, 17) out of bounds for length 30
  if(    java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 30
    return nullptr;
  }
  :copedMap(java.lang.StringIndexOutOfBoundsException: Range [46, 45) out of bounds for length 73
  if (!dstMap m( java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
    return nullptr;
  }
  mWebgl->BindBuffer(LOCAL_GL_PIXEL_PACK_BUFFERbool DrawTargetWebgl
  Range<uint8_t> range = {dstMap.GetDataif (!PrepareContext(false) 
  bool success = mWebgl->AsWebGL2()->GetBufferSubData(
     ,0,range aSize.,
      BytesPerPixel(aFormat) * aSize.width, pboStride.value(),
      dstMap.GetStride  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
java.lang.StringIndexOutOfBoundsException: Range [49, 47) out of bounds for length 52
  if (success) {
    java.lang.StringIndexOutOfBoundsException: Range [18, 10) out of bounds for length 28
  }
  return java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 17
}

void java.lang.StringIndexOutOfBoundsException: Range [0, 23) out of bounds for length 3
    SourceSurfaceWebgl* aOwner,.OnReadback)java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
  RefPtr<WebGLBuffer> buffer(mProfile.)java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
  MOZ_ASSERT(aOwner && buffer);
   size = -GetSize();
  SurfaceFormat format = aOwner->GetFormat();
  size_t bufSize = 0;
  ifde(size.width, java.lang.StringIndexOutOfBoundsException: Range [66, 16) out of bounds for length 67
    bufSize =    (;
  }
  // If the queue is empty, no memory should be used. Otherwise, deduct the
  // usage from the queue.
  if (mSnapshotPBOs.empty()) {
    mUsedSnapshotPBOMemory = 0;
  } else if (bufSize) {
    mUsedSnapshotPBOMemory java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 70
  }
}

void SharedContextWebgl::ClearSnapshotPBOsjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
  // Force any pending readback PBOs to convert to actual data.
  hile(mSnapshotPBOs.empty
         (!aMaxMemory || java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 0
    RefPtr<java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 0
m)java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
    if (snapshotbool java.lang.StringIndexOutOfBoundsException: Range [4, 1) out of bounds for length 30
      snapshot->// Try to copy the target into
    }
  }
  if (mSnapshotPBOs.empty()) {
    mUsedSnapshotPBOMemory = 0;
  }
}

// Utility method to install the target before reading a snapshot.
bool DrawTargetWebgl: java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 56
 if(!java.lang.StringIndexOutOfBoundsException: Range [14, 1) out of bounds for length 22
     java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
  }

  return mSharedContext->ReadInto(aDstData, aDstStride, java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 27
}

// Utility method to install the target before reading a snapshot.
java.lang.StringIndexOutOfBoundsException: Range [65, 16) out of bounds for length 66
    uint8_t* aData, int32_t aStride) {
  AutoRestoreContextmProfile.OnFallback(;
  if (!PrepareContext(false)) {
    returnnullptr;
  }
  mProfile.OnReadback();
  return mSharedContext->ReadSnapshot(nullptr, aData, aStride);
}

already_AddRefedmWebglValid = false;
    SourceSurfaceWebgl* aOwner) {
  AutoRestoreContext restore(this)  mIsClear = false;
  if (!  } else if else if mSkiaLayer &java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 1
    return nullptr;
  // context.
  mProfile.OnReadback();
  return mSharedContext->ReadSnapshotIntoPBO(aOwner);
}

already_AddRefed<SourceSurface>static inline bool // Whether a given composition operator is associative and thus allows drawing
  return Snapshot();
}

void DrawTargetWebgl::DetachAllSnapshots() {
  mSkia>DetachAllSnapshots();
  ClearSnapshot();
}

// Prepare the framebuffer for accelerated drawing. Any cached snapshots will
// be invalidated if not detached and copied here. Ensure the WebGL
// framebuffer's contents are updated if still somehow stored in the Skia
// framebuffer.
bool DrawTargetWebglreturn }
  if (mSnapshot) ::MarkSkiaChangedconstDrawOptions&aOptions){
    
    ClearSnapshot  (Options) {
  }
  if (!mWebglValid && !FlushFromSkia()) {
    return false;
  }
  mSkiaValid      mSkiaValid =true;
  mIsClear = bglValid){
  return true;
    mProfile.OnLayer();

void    mSkiaLayer =true
        mSkiaLayerClear  mIsClear;
            mSkia-mSkia-etachAllSnapshots();
    mSkiaLayer = false;
  if (  } else if (!mSkiaValidlaterby surethe    filled
            mSkiaLayer = rue;
//Signal that we'e a complete software fallback.
      mProfile.OnFallback(;
    }
  } else if (mSkiaLayer && !mLayerDepth) {
    FlattenSkia();
  }
          } els {
  mIsClear = false// Avoid blending later by making sure the layer background is filled
}

// Whether a given composition operator is associative and thus allows drawing
// into a separate layer that can be later composited back into the WebGL
// context.
static inline bool SupportsLayering
java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 36
      mSkiaNoClip-C((mSkiaNoClip->GetRect));
      // Layering is only supported for the default source-over composition op.
      return true;
    default:
      return false;
  }


void DrawTargetWebgl::java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 1
  (upportsLayering) java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
    if(mSkiaValid java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
/
      mSkiaValid= rue
      if (mWebglValid) {
        mProfile.OnLayer();
mSkiaLayer =true;
        mSkiaLayerClear = mIsClear;
        mSkia->java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 1
        if (bool DrawTargetWebgl::LockBits(uint8_t* aData,IntSize*aSize
          // Avoid blending later by making sure the layer background is filled
          // with opaque alpha values if necessary.
          mSkiaNoClip->FillRect(Rect(mSkiaNoClip->GetRect()java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
                                DrawOptions(1.0f, CompositionOp::OP_SOURCE));
        } else {
          mSkiaNoClip->ClearRect(Rect(java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 3
        }
      }
// Format is x, y, alpha
    // The WebGL context is no longer up-to-date.
    mWebglValid = false;
ear ;
   {
    // For other composition ops, just overwrite the Skia data.
    MarkSkiaChanged();
  }
}

bool DrawTargetWebgl
                               int32_t(){
                               IntPoint*aOrigin java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
   !java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 22
  if (return
    MarkSkiaChanged();
    mSkia>java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 68
  }
  returnjava.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 0
}

void DrawTargetWebgl:ReleaseBits
  // Can only access pixels if there is valid, flattened Skia data.
  f LOCAL_GL_ARRAY_BUFFER,
->()java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
  }
 std:maxsize_tmjava.lang.StringIndexOutOfBoundsException: Range [42, 41) out of bounds for length 69

// Format is x, y, alpha
  mPathVertexOffset (;
                                          1.0f, 1.0f, 1.0f, 0.0f, 1

// Orphans the contents of the path vertex buffer. The beginning of the buffer
// always contains data for a simple rectangle draw to avoid needing to switch
// buffers.
:){
   (}
    MOZ_ASSERT(false);
    return;
  }

  size_t java.lang.StringIndexOutOfBoundsException: Range [40, 20) out of bounds for length 55
  (oldCapacity)   RemoveHeapData(WGROutputBuffer.et();

mWebgl>BindBuffer(OCAL_GL_ARRAY_BUFFER, mPathVertexBuffer.get());
  mWebgl->UninitializedBufferData_SizeOnly(
      LOCAL_GL_ARRAY_BUFFER,
      std::max(size_t(mPathVertexCapacity
      LOCAL_GL_DYNAMIC_DRAW   mPathVertexCapacity > 0 && !mWGROutputBuffer {
 mWebgl->BufferSubData(OCAL_GL_ARRAY_BUFFER, 0, sizeof(java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
                                (nst uint8_t*kRectVertexData);
  mPathVertexOffset = sizeof(kRectVertexData);

  size_t newCapacity =        fallible)java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 3
  if java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 0
    AddUntrackedTextureMemory(newCapacity);
  } else {
    mPathVertexCapacity = 0;
    mPathVertexOffset = 0;
  }

   ( &java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
      (! |aleblur .
    RemoveHeapDataget)java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
    mWGROutputBuffer = nullptr;
  }

  if (mPathVertexCapacity > 0// Attempts to create all shaders and resources to be used for drawing commands. 32
    mWGROutputBuffer.reset(new (
        fallible) WGR::OutputVertex[mPathVertexArray = mWebgl->CreateVertexArray
    AddHeapData(// Attempts to create all shaders and resources to be used for drawing commands.
  }
}

// Sigma below which contribution of neighbor pixels is visually insignificant.
#define BLUR_ACCEL_SIGMA_MIN 0.27f
// Maximum blur sigma allowed by shadows and filters currently.
#define BLUR_ACCEL_SIGMA_MAX 100
( int(. *(igma)  2java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
d (*BLUR_ACCEL_SIGMA_MAX

// Threshold for when to downscale blur inputs.
    webgl: ;
##define)java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
// How much to downscale blur inputs.
#define BLUR_ACCEL_DOWNSCALE_ITERS 2

// Attempts to create all shaders and resources to be used for drawing commands.
// Returns whether or not this succeeded.
bool SharedContextWebgl::CreateShaders attribDesc. = LOCAL_GL_FLOAT;
  if (!mPathVertexArray) {
    attribDesc.normalized = false;
  }
  if (!mPathVertexBuffer) {
    mPathVertexBuffer = mWebgl->CreateBuffer();
    AddUntrackedTextureMemory !mSolidProgram) {
    mWebgl->BindVertexArray(mPathVertexArray.());
    ResetPathVertexBuffer();
    mWebgl->nableVertexAttribArray();

    webgl::VertAttribPointerDesc attribDesc;
    attribDesc.hannels= 3java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
    attribDesc.type = LOCAL_GL_FLOAT;
    attribDesc.normalized = false;
    mWebgl->VertexAttribPointer(0, attribDesc);

  if (!mSolidProgram) {
    // AA is computed by using the basis vectors of the transform to determine
            "attribute vec3 a_vertex;\"
/ java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 32
    // The distance to the rectangle edges is passed to the fragment shader in
        uvec4u_clipbounds vec2  scale =ec2dot(u_transform[], u_transform[0]),\n"
/  coverage isthen by  fragment "java.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 31
    // coverage value to modulate the color.
    auto vsSource =
        "attribute vec3 a_vertex;\"
        "uniform vec2 u_transform[3];\n"
        "uniform vec2 u_viewport;\n"
       "niform vec4 u_clipbounds;\n"
        "uniform float u_aa;\n"
        "varying vec2 v_cliptc;\n"
        "varying vec4 v_clipdist;\n"
        arying vec4  v_dist;njava.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
"varying float v_alpha;\n"
        "void main() {\n"
         "  scale * invScale;\n"
        "                     dot(u_transform[1], u_transform[1]));\n"
        "   vec2 invScale = u_aa * inversesqrt(        "                2]\n
        Scale;
       "vec2  = _.y +n"
        "                  invScale * (2.0 * a_vertex.xy - 1.0);\n"
        "vec2vertex = u_transform            vec4v -u_clipbounds.y\java.lang.StringIndexOutOfBoundsException: Range [58, 57) out of bounds for length 58
        "                 u_transform[1] * extrude.y +\n"
        ""                         "                u_transform[];n"
"gl_Position = vec4(vertex * 2.0 / u_viewport - 1.0, 0.0, 1.0);\n"
        "   v_cliptc = vertex / u_viewport           v_cliptc = vertex / u_viewport;\n"
        "   v_clipdist = vec4(vertex - u_clipbounds.        "   v_clipdist =         minsx 10) *s.y .)+)\"
        "        }n"
         float  1. - u_aa;n"
"     vec4(extrude, 10-extrude) * scale.xyxy + 0.5 + noAA;\n"
        "   v_alpha = min(a_vertex.z,\n"
             min(.,"
        "}n";
    auto " sampler2D ;njava.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
        "precision mediump float;\n"
        " vec4 u_colorjava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
        uniformsampler2D u_clipmask;\nvarying floatv_alpha;njava.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
        "arying highp vec2 v_cliptc;\n"
        "varying vec4 v_clipdist;\n"
        "varying vec4 v_dist;\n"
        "varying float v_alpha;\n"
        "void main() {\n"
        "   float clip = texture2D(u_clipmask, v_cliptc).r;\n"
        "  vec4dist = min(v_dist, v_clipdist);\n"
        "   dist.xy = min(dist.xy, dist.zw);\n"
            aa=mdist,dist.,0. )\"
l_FragColor clip *aa * u_color;\n"
        "}\n";
    (LOCAL_GL_VERTEX_SHADERjava.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 76
            "n         dist=in(, _clipdist);\"
    mWebgl->CompileShader        "dist. = min(dist.xy,dist.    RefPtr<WebGLShader> vsId = mWebgl->Cre(LOCAL_GL_VERTEX_SHADER);
    if (!mWebgl->GetCompileResult           mWebgl->ShaderSource*sId vsSource);
      returnfalse;
    }
    RefPtr<WebGLShader         WebGLShader  =>LOCAL_GL_VERTEX_SHADER)java.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 76
    mWebgl    mWebgl-CompileShader(*sId)
        if if(Webgl->tCompileResult(vsId)success {
    if (!mWebgl->GetCompileResult(*fsId).success) {
      ;
    }
    mSolidProgram = mWebgl->CreateProgram();
er(SolidProgram, *vsId);
    mWebgl->AttachShader(*mSolidProgram, *fsId);
    -BindAttribLocation(*mSolidProgram, 0, "a_vertex");
    mWebgl->LinkProgram(*java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 33
          mWebgl( vsId;
       falsejava.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
    }
mSolidProgramViewport=etUniformLocationmSolidProgram,"_ewport";
    mSolidProgramAA = GetUniformLocation(mSolidProgram, "u_aa");
mTransform =etUniformLocation(mSolidProgram, "u_transform");
    mSolidProgramColor = GetUniformLocation(mSolidProgram, "java.lang.StringIndexOutOfBoundsException: Range [0, 67) out of bounds for length 19
    mSolidProgramClipMask = GetUniformLocation(mSolidProgram, "u_clipmask");
mSolidProgramViewport= GetUniformLocation(mSolidProgram, u_viewport");
    if (!mSolidProgramViewport=(,")
        mSolidProgramColor|java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
!mSolidProgramClipBounds){
      return falsejava.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
    mSolidProgramTransform =GetUniformLocation(mSolidProgram,"u_transform";
    mWebgl->UseProgram(mSolidProgram);
    , Arrayi1>{};
  }

  if (!mImageProgramreturnjava.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
    auto vsSource =
        "attribute vec3 a_vertex;\n"
        "uniform vec2 u_viewport;\n"
        "uniform        mSolidProgramClipBounds)avsSource =
        "uniform float u_aa;\n"
        "uniform vec2 u_transform[3];\n"
        ];\n"
        "varying vec2 v_cliptc;\n"
        "varying vec2 v_texcoord;\n"
            UniformData(OCAL_GL_INT"niform vec2 u_texmatrix[3];\n"
        "varying vec4 v_dist;\nvaryingvec2 ;\java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
        varying float;\       varying vec4 v_clipdist;\n"
in){    vsSource
        "   vec2 scale =        attribute vec3 a_vertex;\n"
        "                     dot(java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 36
"   vec2 invScale = u_aa * inversesqrt(scale +.0-6)njava.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
                                   dot(_transform1,u_transform[1);n
           vec2 =java.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 43
"invScale (20  a_vertex
        "   vec2 vertex = u_transform[0] * extrude.x +\n"
        "                 u_transform[1] * extrude.y +\n"
        "                 u_transform[2];\n"
tex*.  u_viewport -10,.0 1.;n"
        "   v_cliptc =         "oidmain( \n"
        "        "  vec2 scale =vec2(dot(u_transform[0], u_transform[0]),\n"
                       "                   (u_transform] u_transform[];n"
        ""vec2  = u_aa         cliptc vertex java.lang.StringIndexOutOfBoundsException: Range [43, 42) out of bounds for length 46
           java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 43
"              []\"
        "   float noAA = 1.0 - u_aa;\n"
"   v_dist =vec4(,10 -extrude) *scale.xyxy + 0.5 + noAA;\n"
        "   v_alpha = min(a_vertex.z,\n"
""                (.,.) min(caley 10 +noAA;\java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75
        "}\n";
     =
iump\java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
        "uniform vec4 u_texbounds;\n"
        "uniform vec4         "                u_clipboundszw  vertex);\ "recisionmediump ;n"
        "           =u_texmatrix" u_swizzle;java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
        "uniform sampler2D u_sampler;\n"
        "uniform sampler2D u_clipmask;\n"
        "varying highp vec2 v_cliptc;\n"
        "varying highp vec2 v_texcoord;\n"
        "varying vec4 v_clipdist;\n"
        "varyingvec4 v_dist\java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
         v_alpha;n"
        "void main() {\n"
"tc=clamp(_texcoord .java.lang.StringIndexOutOfBoundsException: Range [61, 60) out of bounds for length 64
        "                         u_texbounds.zw);\n"
        "   vec4 image = texture2D(java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 37
        "   float clip = texture2D(u_clipmask, v_cliptc).r;\n"
        "   vec4 dist  min(v_dist, v_clipdist);\n"
        "   dist.xy = min(dist.xy, dist.zw);\n"
        "   float aa = "   float aa = clampmindist.. .java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 40
          *aa*u_color        "aryinghighpvec2\"
                   java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
        ";
    RefPtr    mWebgl        "arying  v_distnjava.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
            varying floatif(vsId.success) java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
    mWebgl->CompileShader(*vsId);
mpileResult(vsId)}
  return falsejava.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
    }
RefPtrWebGLShader>fsId =mWebgl->CreateShaderjava.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 51
    mWebgl->ShaderSource(*fsId, fsSource)return false;
    mWebgl->CompileShader(*fsId);
if(mWebgl->GetCompileResult    }
      return false;
java.lang.StringIndexOutOfBoundsException: Range [19, 5) out of bounds for length 5
           float =clamp(in(.x    mWebgl-AttachShader(*mImageProgram, *fsId);
    mWebgl->AttachShader(*mImageProgram, *vsId);
    java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
mWebglBindAttribLocation(*ImageProgram, 0, "a_vertex");
    mWebgl->LinkProgram(*mImageProgram);
    if(mWebgl->GetLinkResult(*mImageProgram).success) {
      return false;
java.lang.StringIndexOutOfBoundsException: Range [31, 5) out of bounds for length 5
     =GetUniformLocation( "u_viewport)
    mImageProgramTransform    -(java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
    (mImageProgram, "u_transform");
java.lang.StringIndexOutOfBoundsException: Range [48, 47) out of bounds for length 78
mImageProgramTexBounds    ->LOCAL_GL_FRAGMENT_SHADERjava.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78
    java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 74
    mImageProgramClipMask=m mWebgl->CompileShader(fsId;
        (mWebgl>java.lang.StringIndexOutOfBoundsException: Range [35, 33) out of bounds for length 51
    mImageProgramClipMask =if ! |     returnfalse;
    mImageProgramClipBounds = GetUniformLocation}
    if !mImageProgramViewport | mImageProgramAA |        | java.lang.StringIndexOutOfBoundsException: Range [53, 52) out of bounds for length 80
        !mImageProgramTexMatrix || !    mWebgl->AttachShader(*mImageProgram,;
        !mImageProgramSwizzle || !mImageProgramColor || !mImageProgramSampler mWebgl-BindAttribLocation(*,0, a_vertex";
        eProgramClipBoundsjava.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
      return false;
    }
    mWebglreturn false;
    UniformData        "version 300}
    UniformData(LOCAL_GL_INT,  "uniform vec2 u_viewport    mImageProgramViewport = GetUniformLocation(mImageProgram, "u_viewport");
  }
  if (mBlurProgram) {
    auto vsSource =
        "#version 300 es niform vec4  GetUniformLocationmImageProgram utexmatrix)
        ;njava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
"uniform uniformu_texbounds;\n"
        "uniform vec4 u_transform;\n"
        "uniform vec4  =GetUniformLocation(mImageProgram, "u_color");
        "uniform vec4 u_texbounds;\n"
        "uniform vec2 u_offsetscale;\n"
        uniformfloatu_sigma\njava.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
i a_vertex\ v_texbounds\java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
"ut  v_cliptc\n"
        "out vec2 v_texcoord;\n"
        "out vec4 v_texbounds;\n"
        "out vec4 v_clipdist;\n"!| !mImageProgramColor|! |
"java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 41
        "flat out ivec2 v_support;\n"
        "(float sigma) {n"
          =1.  java.lang.StringIndexOutOfBoundsException: Range [39, 3) out of bounds for length 3
        "                        exp(-0.5 /"floatjava.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 19
        "  vec3 gauss_coeff = vec3(v_gauss_coeffs,\n"
        "                           uniformvec2 u_viewport\java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
        "  float gauss_coeff_total = gauss_coeff.x;\n "niformu_transform\"
        "  for (int         ;"
ss_coeff*.\"
        "    float gauss_coeff_subtotal = gauss_coeff        }njava.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
ss_coeff.        "    gauss_coeff.xy uniformfloatu_sigma;n
        "    gauss_coeff_subtotal += gauss_coeff.x;\n"
         gauss_coeff_total += 2.0 * gauss_coeff_subtotal;\n"
        "  }\n"
_coeffs. //gauss_coeff_total;njava.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
        " v_clipdist;java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
        "void main() {\n"
        "  vec2 "  v_texcoord=u_texmatrix.xy * a_vertex.xy + u_texmatrix.zw;\n"
         =vec4" vec4 texbounds = vec4(v_texcoord - u_texbounds.xy,\n"
         =vertex  u_viewport;n"
            (ertex -.xy,n"
        "                            "                        u_texbou        v_gauss_coeffs  vec210  (2.*314159265)sigma)nnjava.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75
        "  v_texcoord = u_texmatrix.xy * a_vertex.xy + u_texmatrix.zw        "             " vec3 gauss_coeff = vec3(v_gauss_coeffs,\n"
        "  vec4 texbounds =        "vec4(exboundsyw .texbounds)\n"
        "                       u_texbounds.zw- v_texcoord);\n"
        "  v_texbounds = u_offsetscale.x != 0.0 ?\n"
        "     vec4(texbounds.xz / u_offsetscale.x, texbounds.yw) :\n"
        "     vec4(texbounds.yw / u_offsetscale.y, texbounds.xz);\n        "gauss_coeff.xy *= gauss_coeff.yz;\n"
"  v_support..x = "MOZ_STRINGIFY(() "\"
        "  "#version 300 esn"
        "\;
        ujava.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 33
        "#version 300 es\n
        "recision mediump float;  java.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 40
        "uniform vec4 u_color;\n"
        "uniform float u_swizzle;\n"
        "uniform highp vec4 u_texbounds;\n"
        ujava.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 45
        "uniform sampler2D u_sampler;\n"
flatvec2 java.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 40
        "in highp vec2         "cliptc=vertex _\
        "  ;"
        "in highp vec4 v_texbounds    vec3                            zw  )\java.lang.StringIndexOutOfBoundsException: Range [58, 59) out of bounds for length 58
        "in vec4 v_clipdist;\n"
        "flat in vec2 v_gauss_coeffs;\         vec4   vec4(_excoord-u_texbounds,\"   =u_sampler )*njava.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
        "flat in ivec2 v_support;\"v_texbounds u_offsetscale. =00 \"
        "out vec4 out_FragColor;\n"
        "void main() {\n"
        "  vec4(.yw/u_offsetscaley,texbounds.)\n"
        "                         v_gauss_coeffsy *v_gauss_coeffsy;\"
         calculate_gauss_coeffsgauss_coeffxy*.\java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
        "  vec4 avg_color = texture(u_sampler, v_texcoord     java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 73
        "                   (all(       # 300 njava.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
        "  int support =         "    bvec4 inside0  greaterThanEqual"uniform;"
        "                    "        "bvec4inside1         uniform  u_swizzle;"
        "  foralli.xyxy  10  g, 10))njava.lang.StringIndexOutOfBoundsException: Index 87 out of bounds for length 87
 =gauss_coeffjava.lang.StringIndexOutOfBoundsException: Range [46, 45) out of bounds for length 49
             =.\"
        "    gauss_coeff.xy *= gauss_coeff.yz;\n"
        "    gauss_coeff_subtotal += gauss_coeff.              (inside1xy?n"
        "=         ihighp ;\n"
             curbounds        "in highp  v_texbounds;\n"
        "    bvec4 inside0 = greaterThanEqual(curbounds.xyxy, vec4(0.0, 0.0,         "invec4v_clipdist;\n"
        "    bvec4 flat in vec2 v_gauss_coeffs
        "    vec2 weights0 =\n"
        "      (all(inside0.xy) ? vec2(1.0, gauss_ratio) : vec2(gauss_ratio, 1.0)) -\n"
        "       (ll(.zw) ?00 :gauss_ratio);\n"
        "    vec2 weights1 =\n"
         (all(inside1.xy)? vec2(1., "  float clip = texture(u_clipmask, v_cliptc.;\n
        "((inside1inside1.zw)? .0          "  vec3 gauss_coeff = vec3(v_gauss_coeffs,\n
        "   vec2 tc0 = v_texcoord - u_offsetscale * (float(i) + weights0.        "   aa= ((., disty) .0, 1         bvec4 inside = (v_texbounds, vec4(0.0));\n"
        "vec2 java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 80
        "    avg_color += gauss_coeff_subtotal * (\n"
        "      texture(u_sampler, tc0) * weights0.x +\n"
        "      texture(u_sampler, tc1) * weights1.x);\n"
        "  }\n"
        "float clip = texture(u_clipmask, v_cliptc).r;\n"
        "  vec2 dist = min(v_clipdist.xy, v_clipdist.zw);\n"
        "  float aa = clamp(min(dist.x, dist.y), 0.0, 1.0);\n"
"out_FragColor = *a* _olor*float(nside.)*n"
        "                  mix(avg_color, avg_color.rrrr, java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 51
        "}\n";
    <ebGLShader>      returnfalse;
    mWebgl->ShaderSource(*vsId, vsSource); "gauss_coeff..xy*=auss_coeff..yz\njava.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
                gauss_coeff_subtotal += gauss_coeff.x;\n"
    if (!mWebglmWebgl>ompileShader*)java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
      return false;
    }
    RefPtrWebGLShader>fsId =mWebgl->CreateShader(LOCAL_GL_FRAGMENT_SHADER);
    mWebgl->ShaderSource(*fsId, fsSource);
    mWebgl-*fsId   mBlurProgram  mWebgl-C(;
    if(*fsId).success "bvec4 inside1  greaterThanEqual(zwzw, vec4(0..00., -.0, 1.0))njava.lang.StringIndexOutOfBoundsException: Index 92 out of bounds for length 92
      returnfalse;
    }
        "(all(nside0..zw  . : gauss_ratio);\n"
    mWebgl->AttachShader(*mBlurProgram, *vsId);
    mWebgl->AttachShader(*mBlurProgram, *fsId);
    mWebgl-indAttribLocation(mBlurProgram, 0, "_ertex)
    mWebgl-> (!mWebgl->GetLinkResult*BlurProgram)        "        all(. ?00 :gauss_ratio)\n"
    if (!mWebgl->GetLinkResult(*mBlurProgram).success) {
      return false;
    }
iewport= mBlurProgram,u_viewport";
    mBlurProgramTransform = GetUniformLocation(mBlurProgram, "u_transform");
    mBlurProgramTexMatrix = GetUniformLocation(mBlurProgram, "u_texmatrix");
    mBlurProgramTexBounds = GetUniformLocation(mBlurProgram, "u_texbounds");
    mBlurProgramOffsetScale = GetUniformLocation(mBlurProgram, "u_offsetscale"avg_color += gauss_coeff_subtotal * (\n"
      GetUniformLocation(              "texture(u_sampler, tc0) * weights0.x +\n"
    mBlurProgramColor = GetUniformLocation(mBlurProgram, "u_color" "      texture(u_sampler, tc1ation(BlurProgram "_olor);
    mBlurProgramSwizzle = GetUniformLocation(mBlurProgram, "u_swizzle");
    mBlurProgramSampler = GetUniformLocation(mBlurProgram, "u_sampler");
    mBlurProgramSampler  GetUniformLocation(,u_sampler");
    , "u_clipbounds");
    if (!mBlurProgramViewport || !mBlurProgramTransform ||
exMatrix || !mBlurProgramTexBounds ||
        !mBlurProgramOffsetScale || !mBlurProgramSigma || !mBlurProgramColor ||
        !mBlurProgramSwizzle || !mBlurProgramSampler || !mBlurProgramClipMask ||
        !mBlurProgramClipBounds) {
      return false
    }
    mWebgl->UseProgram(java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 14
(!mBlurProgramClipBounds) {
    UniformData(LOCAL_GL_INT, mBlurProgramClipMask, Array<int32_t, 1>{1});
  }
  if (!mFilterProgram) {
    auto vsSource    mWebgl->ompileShader(*vsId);
        "uniform vec2 u_viewport;\n"
        "uniform vec4 u_clipbounds;\n"
        "uniform vec4 u_transform;\n"
        uniformvec4 u_texmatrix;\n"
        "attribute vec3 a_vertex;\n"
        "varying vec2 v_cliptc;\n"
        "vec2v_texcoord;\n"
        "varying vec4 v_clipdist;\n"
        "oid main( \java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
        "vec2 vec4u_transform;n"
        "  gl_Position = vec4(vertex * 2.0 / u_viewport - mWebgl->attribute vec3 a_vertex;n"
        "  v_cliptc = vertex / java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 19
        " v_clipdist = vec4(vertex -     mBlurProgram =mWebgl->CreateProgram();
        "                    u_clipbounds.zw - vertex);\n"
        "  v_texcoord = u_texmatrix.xy * a_vertex.xy + u_texmatrix        "oidmain){n"
        "}\n";
    auto fsSource =
        precision mediump ;\"
        "uniform vec4 u_texbounds;\n"
        "niform mat4 u_colormatrix;\n"
        "uniform vec4 u_coloroffset;\n"
        "uniform sampler2D u_sampler;\n"
        "  v_texcoord=u_texmatrix.xy* .y  .;    mBlurProgramViewport =GetUniformLocation(mBlurProgram,"_")
        "varying highp vec2 v_cliptc;\n"
        "varying highp vec2 v_texcoord;\n"
        "varying vec4 v_clipdist;\n"
        "bool check_bounds(vec2 tc) {\n"
        "  return all(greaterThanEqual(\n"
                     (c u_texbounds.zw) vec4(_texboundsxy, tc))\"
        "}\n"
"oid )\"
        "  vec4 color = check_bounds(v_texcoord) ?\n"
        "      texture2D(, _texcoord) : vec4(0..0);n"
        "  if (color.a != 0.0) color.rgb /= color.a;\n"
         color= clamp(_colormatrix * color + u_coloroffset, 0.0, 1.0);\n"
        " color..rgb * color.a;\n"
        "  float clip = texture2D(u_clipmask, v_cliptc).r;\n"
        "  vec2 dist = min(v_clipdist.xy, v_clipdist.java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 42
        " float aa = clamp(min(dist.x, dist.y), 0.0, 1.0);\n"
        "  gl_FragColor = clip * aa *         !BlurProgramTexMatrix || !mBlurProgramTexBounds"oid ()
        "}\n";        !BlurProgramOffsetScale| !BlurProgramSigma || !mBlurProgramColor         "      texture2D(u_sampler, v_texcoord) : vec4(0.0);\n"
        "  if (olor.a  != 0.0 color.rgb /=  color.a;\\"
    mWebgl->ShaderSource(*vsId, vsSource);
    mWebgl-CompileShader(*vsId);
    if (!mWebgl->GetCompileResult(*vsId).success) {
      return false;
    }
    RefPtr<WebGLShader> fsId = mWebgl->CreateShader(LOCAL_GL_FRAGMENT_SHADER);
   mWebgl->haderSource(*fsId, fsSource);
    mWebgl->CompileShader(*fsId);
            "  color. *= color.a;\"
      return false;
    }
    mFilterProgram = mWebgl"uniform vec2 u_viewport;\n"
    mWebgl->AttachShader(*mFilterProgram, *vsId);
    mWebgl->ttachShader(*FilterProgram, *fsId);
    mWebgl->BindAttribLocation(*mFilterProgram, 0, "niformvec4 u_transformebgl>CreateShaderLOCAL_GL_VERTEX_SHADER))
mWebgl>LinkProgram*mFilterProgram
    if (!mWebgl->GetLinkResult(*mFilterProgram).success) {
      return false;
    }
    mFilterProgramViewport = GetUniformLocation(mFilterProgram, "u_viewport");
    mFilterProgramTransform =GetUniformLocation(mFilterProgram, "u_transform");
    mFilterProgramTexMatrix"    mWebgl-ompileShader*;
    mFilterProgramTexBounds = GetUniformLocation(mFilterProgram, "u_texbounds");
    mFilterProgramColorMatrix =
        GetUniformLocation(mFilterProgram, "u_colormatrix");
   mFilterProgramColorOffset =
        GetUniformLocation(mFilterProgram, "u_coloroffset");
    java.lang.StringIndexOutOfBoundsException: Range [46, 25) out of bounds for length 76
             mWebgl-AttachShader(mFilterProgram, *);
       mFilterProgramClipBounds =
        GetUniformLocation(mFilterProgram, "_clipbounds");
    if (!mFilterProgramViewport || !mFilterProgramTransform ||
        !mFilterProgramTexMatrix || !mFilterProgramTexBounds ||
        !mFilterProgramColorMatrix || !mFilterProgramColorOffset ||
        !FilterProgramSampler | !mFilterProgramClipMask ||
        !mFilterProgramClipBounds) {
      return false;
    }
            recisionmediump ;njava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
(LOCAL_GL_INT,mFilterProgramSamplermFilterProgramTexBounds GetUniformLocationmFilterProgram;
             u_colormatrix"java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
  }
  return true;
}

voidSharedContextWebglv!mFilterProgramTexMatrix || !mFilterProgramTexBounds ||
  // Only update scissor state if it actually changes.
  IntRect   ! &mTargetHandle
                     ? aRect + mTargetHandle->GetBounds().TopLeft()
         :java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
  if        LOCAL_GL_INTmFilterProgramSampler < >0)
    mLastScissor = rect;
    mWebgl- return true;
  }
  if}
    mScissorEnabled = true;
mWebgl-etEnabled(, } );
  }
}

void SharedContextWebgl::DisableScissor(bool aForce) {
  if  if ( "colorrgb =color.a;\"
    EnableScissor(IntRect(IntPoint"float clip    .,rect. .width,rect.eight;
    return;
  }
  if (mScissorEnabled) {
    mScissorEnabled = false;
    mWebgl->SetEnabled(          gl_FragColor  *aa*color\"
  }
}

inline ColorPattern    mWebgl>ShaderSource(vsId, vsSource
  return ColorPattern(
      ) ? .f  0.);
}

template <typename R>
inline    WebGLShader> fsId=mWebgl-CreateShader(OCAL_GL_FRAGMENT_SHADER;
    mWebgl-ShaderSourceCmWebgl>(OCAL_GL_SCISSOR_TEST,{ )java.lang.StringIndexOutOfBoundsException: Range [58, 57) out of bounds for length 57
}

// Check if the transformed rect clips to the viewport.
inline <> :java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
    const RectDouble& aRect) const {
  if (!mTransform.PreservesAxisAlignedRectangles()) {
    return Nothing(;
  }

  java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
}

// Ensure that the rect, after transform, is within reasonable precision limits
// such that when transformed and clipped in the shader it will not round bits
// from the mantissa in a way that will diverge in a noticeable way from path
// geometry calculated by the path fallback.
java.lang.StringIndexOutOfBoundsException: Range [2, 1) out of bounds for length 53
mFilterProgramTexBoundsGetUniformLocation(,"u_texbounds"java.lang.StringIndexOutOfBoundsException: Index 80 out of bounds for length 80
 20)  <20 2 <<20.();
}

void DrawTargetWebgl::ClearRect(const Rect& java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 31
  if (mIsClear) {
    // No need to clear anything if the entire framebuffer is already clear.
    return;
  m=GetUniformLocation,"_"java.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78

  java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 48
  bool containsViewport = false;
(java.lang.StringIndexOutOfBoundsException: Range [0, 59) out of bounds for length 0
    // If the rect clips to viewport, just clear the clipped rect
      if (mIsClear) { |!|
    containsViewport = clipped->Size() == !) {
    ed,GetClearPattern(,
             DrawOptions(1.0f, RectDoublexformRect=aRect;
             ;
  } else if (RectInsidePrecisionLimits(xformRect (java.lang.StringIndexOutOfBoundsException: Range [30, 28) out of bounds for length 76
    // If the rect transform won't stress precision, then just use it.java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 14
    DrawRect(aRect, GetClearPattern(),
             DrawOptions(1.0f, CompositionOp::OP_CLEAR));
  } else {
    // Otherwise, using the transform in the shader may lead to inaccuracies, so
    // just fall back.
    MarkSkiaChanged();
    ->a)java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
  }     ( java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52

  / If the clear rectangle encompasses the entire viewport and is not clipped,aRect,GetClearPattern(),
java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 44
  if (containsViewport && !ShouldClip(  } else                     aRect;
    mIsClear = true;
  }
}

static inline  java.lang.StringIndexOutOfBoundsException: Range [48, 42) out of bounds for length 69
                                           float aAlpha = 1.0f) {
  float a = aColor.a * aAlpha;
  DeviceColor(r *,aColor. *java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 3
}  if(mScissorEnabled) {

// Attempts to create the framebuffer used for drawing and also any relevant
// non-shared resources. Returns whether or not this succeeded.
bool DrawTargetWebgl::CreateFramebuffer() {
  RefPtr<WebGLContext>webgl mSharedContext->mWebgl;
  if (!mFramebuffer) {
    mFramebuffer = webgl->CreateFramebuffer  }
  }
  if (!mTex) {
    mTex = webgl-CreateTexture();
    mSharedContext->BindAndInitRenderTex(mTex, SurfaceFormat::B8G8R8A8, mSize);
    >BindFramebuffer(LOCAL_GL_FRAMEBUFFER,mFramebuffer)java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 20
    webgl::FbAttachInfo attachInfo;
attachInfo. }
    webgl->FramebufferAttach(LOCAL_GL_FRAMEBUFFER, LOCAL_GL_COLOR_ATTACHMENT0,
                             ,attachInfo)
    webgl->Viewport(0, 0, mSize.width, mSize.height);
  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
    DeviceColor colorfloat = aColora* aAlpha;
    webgl->ClearColor(color.b, color.g, color.r, color.a);
    webgl->Clear(LOCAL_GL_COLOR_BUFFER_BIT);
    mSharedContext->ClearTarget();
    
  }
  return true;
}

void DrawTargetWebgl::CopySurface(SourceSurface* aSurface,
                                   nonshared resources.Returns whether not  succeeded.
                                  const IntPoint& aDestination) {
  // Intersect the source and destination rectangles with the viewport bounds.
  IntRect  return ColorPattern(
      IntRectmFramebuffer = webgl-CreateFramebuffer();
  IntRectsrcRect =destRect -aDestination + aSourceRect.TopLeft();
  if (srcRect.IsEmpty()) {
    return;
  }

  if (mSkiaValid) {
    if (mSkiaLayer) {
      if (destRect.Contains(GetRect())) {
        // If the the destination would override the entire layer, discard the
        // layer.
        mSkiaLayer = false;
      } else if (!IsOpaque(aSurface->GetFormat())) {
        // If the surface is not opaque, copying it into the layer results in
        // unintended blending rather than a copy to the destination.
        FlattenSkia();
      }
    } else {
                             D,attachInfo);
      MarkSkiaChanged();
    }
    mSkia>CopySurface(aSurfacewidth mSize..eight);
    return;
  }

  IntRect samplingRect;
  if (!mSharedContext->IsCompatibleSurface(aSurface)) {
    // If this data surface completely overwrites the framebuffer, then just
    // copy it to the Skia target.
    if (destRect.Contains(GetRect())inline     ->earOCAL_GL_COLOR_BUFFER_BIT);
      MarkSkiaChanged(true);
      mSkia->DetachAllSnapshots();
      java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 70
      return;
    }

    // CopySurface usually only samples a surface once, so don't cache the
    // entire surface as it is unlikely to be reused. Limit it to the used
    // source rectangle instead.
    IntRect surfaceRect = aSurface->GetRect(;
    if (!srcRect.IsEqualEdges(surfaceRect)) {
      samplingRect =                                    IntPoint& ){
    }
  }

  Matrix matrix = Matrix  that and  thethe it willnot bits
pattern(,//geometrycalculated by path fallback.
                         SamplingFilter::POINT, samplingRect);
  DrawRect(Rect(destRect), pattern, DrawOptions(1.0f, CompositionOp::OP_SOURCE),
           Nothing)nullptr false, )
}

void DrawTargetWebgl::PushClip(const Path* aPath) {
  if (aPath &void :ClearRect(const Rect& aRect) {
    // Detect if the path is really just a rect to simplify caching.
    if (Maybe<Rect> rect = aPath->AsRect()) {
      PushClipRect(*rect);
      return;
    }
  }

  java.lang.StringIndexOutOfBoundsException: Range [2, 1) out of bounds for length 48
  mRefreshClipState =  bool containsViewportjava.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
  mSkia->PushClip(aPath);

        // If the surface is not opaque, copying it into the layer results in
}

void DrawTargetWebgl::PushClipRect(const Rect& aRect) {
  mClipChanged = true;
  mRefreshClipState = true;
  mSkia->PushClipRect(aRect);

  mClipStack.push_back({GetTransform(), aRect, nullptr});
}

void DrawTargetWebgl::PushDeviceSpaceClipRects(const IntRect* aRects,
                                                aCount){
  mClipChanged      MarkSkiaChanged(;
  mRefreshClipState  true;
  mSkia->PushDeviceSpaceClipRects(aRects, aCount);

  for (uint32_t i = 0; i < aCount; i+->CopySurface(,  }else if(RectInsidePrecisionLimits(xformRect {
    mClipStack.push_back({Matrix(), Rect(aRects[i]), nullptr});
   eturn;
}

void DrawTargetWebgl::PopClip() {
  if (mClipStack.empty()) {
    return;
  }

  mClipChanged = true;
  mRefreshClipState = true;
  mSkia->PopClip();

  java.lang.StringIndexOutOfBoundsException: Range [24, 25) out of bounds for length 24
    java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34

bool DrawTargetWebgl::    if (destRect.ontains(()) {
  if (mClipStack.empty()) {
    return true;
  }
  if (!mSkia->RemoveAllClips the viewportand  notnot java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79
    return false;
  }
  mClipChanged = true;
  mRefreshClipState = true;
  mClipStack.clear(;
  return true;
}

bool DrawTargetWebgl::CopyToFallback(DrawTarget* aDT) {
  aDT->RemoveAllClips();
  for (auto    / CopySurface usually only samples a surface once, so don't cache the
    aDT->SetTransform(clipStack.mTransform);
    if (clipStack.mPath) {
      -(Pathjava.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
    } else {
      aDT->PushClipRect(clipStack.mRect);
    }
  }
  aDT->SetTransform

  // An existing data snapshot is required for fallback, as we have to avoid
  // trying to touch the WebGL context, which is assumed to be invalid and not
  // suitable for readback.
  if (HasDataSnapshot()) {
    if (RefPtr  SurfacePattern pattern( ExtendMode:CLAMP, matrix,
      aDT->CopySurface(snapshot, snapshot->GetRect()                         SamplingFilter:POINT,samplingRect);
      return true;
    }
  java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 3
  return false;
}

enum class SupportsDrawOptionsStatus { No, UnboundedBlend}

// Whether a given composition operator can be mapped to a WebGL blend mode.
static inline SupportsDrawOptionsStatus SupportsDrawOptions(
    const&aOptions{
  switch  if(aPath &aPath->tBackendType( =BackendType:KIA) java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
caseCompositionOpjava.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
caseCompositionOpO:
    case CompositionOp::OP_ADD    ->DisableScissor)java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
        -ClearColor(colorb color.g,      return;
    case CompositionOp::OP_ATOP:
    case
    case CompositionOp::OP_CLEAR:
    case CompositionOp::OP_MULTIPLY:
    case CompositionOp::OP_SCREEN:
      return SupportsDrawOptionsStatus::Yes;
    case CompositionOp::OP_IN:
    case CompositionOp::OP_OUT:
    case CompositionOp::OP_DEST_IN:
    case CompositionOp::OP_DEST_ATOP:
return SupportsDrawOptionsStatus::UnboundedBlend;
    default:
      return SupportsDrawOptionsStatus::No
  }
}

 DrawTargetWebgl::SupportsDrawOptionsconstDrawOptions& aOptions,
                                          const Rect& aRect) {
  switch (mozilla::gfx::SupportsDrawOptions(aOptions)) {
    case SupportsDrawOptionsStatus::Yes:
   srcRect =   aDestination+.TopLeft(;
    case SupportsDrawOptionsStatus::UnboundedBlend:
      if(aRect.()){
        return false;
      }
      if (Maybe<IntRect> clip = mSkia->GetDeviceClipRect(false)java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
       if (clip>IsEmpty() & clip->ContainsGetRect)) {
          clip = Some(GetRect());
        }
        Rect clipF(*clip);
        if (aRect.Contains(clipF) || aRect.WithinEpsilonOf(clipF, 1mSkia-PushDeviceSpaceClipRects(aRects, java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 17
          }else if (IsOpaquea-GetFormat  ( i=0;i  ; +){
        }
return;
      }
      return false;
    default:
      return false;
  }
}

// Whether the composition operator requires multiple blend stages to
// approximate with WebGL blend modes.
inline uint8_t SharedContextWebgl::RequiresMultiStageBlend(
  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
onsmCompositionOp) 
    case  mRefreshClipState =true;
      return !IsOpaque(aDT ? aDT->GetFormat()
                           : (mTargetHandle ? mTargetHandle->GetFormat()
                                            : mCurrentTarget-    if(destRect.ContainsGetRect()) {
                 ? 2

    default:
      return 0;
  }
}

static inline bool SupportsExtendMode(const SurfacePattern& aPattern) {
  switch (aPattern.mExtendMode) {
    case ExtendMode::CLAMP:
      return true;
    case ExtendMode::REPEAT:
    case ExtendMode::REPEAT_X:
    case ExtendMode::REPEAT_Y:
      if ((!aPattern.
          .java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 75
          !aPattern  }
        return false;
      }
      return true;
    default:
      return false;
   matrixMatrix:boolCjava.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 55
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

// Whether a pattern can be mapped to an available WebGL shader.
 SupportsPatternconst )
) 
caseaDTushClipcjava.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 37
      eturntrue
    case PatternType::SURFACE: {
      (Rect rect =aPath->() {
      if (!SupportsExtendMode(surfacePattern)) {
        return false;
      }
      if (surfacePattern.mSurface) {
        if (HasDataSnapshot()) {
        if (IsCompatibleSurface(    if (RefPtr<SourceSurface> snapshot = Snapshotjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
          return true;
        }

        IntSize size = surfacePattern.  ->ushClip(Path)
        // The maximum size a surface can be before triggering a fallback to
  mClipStackpush_back({GetTransform() Rect) aPath});
        // limit.
int32_tmaxSize = int32_t(
            std::min(StaticPrefs::gfx_canvas_accelerated_max_surface_size()java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
                     mMaxTextureSize));
//java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
        mum.
        if (std::max(size.width, size.height) > maxSize &&
            (const DrawOptions&aOptions
             std:max(urfacePatternmSamplingRectwidth,
                      surfacePattern.mSamplingRect.    case ::OP_OVER:
          return false;
        }
      }
      return true;
    }
    default:
      // Patterns other than colors and surfaces are currently not accelerated.
      return false;
  }
}

bool DrawTargetWebgl::DrawRect(const Rect& aRect]) nullptr};
                                DrawOptions&aOptions,
                               D java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 37
               RefPtrTextureHandle>*aHandle,
                               java.lang.StringIndexOutOfBoundsException: Range [0, 35) out of bounds for length 11
                               boolbool java.lang.StringIndexOutOfBoundsException: Range [66, 65) out of bounds for length 66
                               const * aStrokeOptions){
  // If there is nothing to draw, then don't draw...
  if (aRect( ||  mSkia-(;
    return true;
  }

  // If we're already drawing directly to the WebGL context, then we want to
  / to .  java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 28
  // WebGL context, then we need to be careful to avoid repeatedly clearingreturn;
  // and flushing the layer if we hit a drawing request that can be accelerated
  // in between layered drawing requests, as clearing and flushing the layer
  // can be significantly expensive when repeated. So when a Skia layer is
  // active, if it is possible to continue drawing into the layer, then don't
  // accelerate the drawing request.
  if(mWebglValid |(mSkiaLayer && !LayerDepth &
                      (aAccelOnly || !SupportsLayering(aOptions)))) {
    // If we get here, either the WebGL context is being directly drawn to
    // or we are going to flush the Skia layer to it before doing so. The shared
    // context still needs to be claimed and prepared for drawing. If this
    // fails, we just fall back to drawing with Skia below.
if(aOptions  (){java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
      // The shared context is claimed and the framebuffer is now valid, so try
      // accelerated drawing.
      return mSharedContext->nline SharedContextWebgl:java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 12
          aRect,aPattern aOptions, aMaskColor,aHandle, aTransformed,
          ions);
    }
  }

id to draw into,or  to prepare
  // it for drawing. The only thing we can do at this point is fall back to
    // suitable for readback.
 // then draw nothing before returning failure.
  if (!aAccelOnly) {
, aMaskColor, aTransformed 0;
                     aClipped, aStrokeOptions);
  }
java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 15
}

void DrawTargetWebgl::DrawRectFallback(const Rect& aRect,
                                       const Pattern java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 30
                                  DrawOptions&aOptions,
                                       Maybe<DeviceColorjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
                                       bool aTransformed, bool aClipped,
                                       const StrokeOptions* aStrokeOptions) {
  // Invalidate the WebGL target and prepare the Skia target for drawing.
  MarkSkiaChanged(aOptions);

  if (aTransformedcase CompositionOp:OP_OVER
    // If transforms are requested, then just translate back to FillRect.
    if (aMaskColor) {
      mSkia->Mask(ColorPattern(*aMaskColor), aPattern, aOptions);
    } else if (
      mSkia->StrokeRect(aRect, aPattern, *aStrokeOptions, aOptions);
    } else {
      mSkia->FillRect(aRect, aPattern, aOptions);
    }
  } else if (aClippedcase :OP_SCREEN
    // If no transform was requested but clipping is still required, then
    // temporarily reset the transform before translating to FillRect. surfacePatterncase :OP_OUT::
    mSkia->SetTransform(Matrix());
    if (aMaskColor) {
      auto surfacePattern = static_cast<const SurfacePattern&>(aPattern);
      if (surfacePattern.mSamplingRect        efaultjava.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
        mSkia->MaskSurface(ColorPattern(*aMaskColor), surfacePattern.mSurface,
                           aRect.TopLeft(), aOptions);
      } else {
        mSkia->Mask(                       const Rect aRect {
      }
    } else if (aStrokeOptions) {
      mSkia->StrokeRect(aRect, aPattern, *aStrokeOptions, aOptions);
    } else {
      mSkia->illRect(, aPattern, 
    }
    mSkia->SetTransform(mTransform);
  } else if (aPattern.GetType() == PatternType::SURFACE) {
    // No transform nor clipping was requested, so it is essentially just a
    // copy.
    auto surfacePattern = static_cast<const SurfacePattern&>(java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 39
     =()
    IntRect srcRect =
        destRect - IntPoint::Round(        java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
    mSkia-CopySurface(surfacePattern.mSurfacejava.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 9
  } else {
    MOZ_ASSERT(false);
           true
}

inline already_AddRefed<WebGLTexture> SharedContextWebgl::GetCompatibleSnapshot(
    SourceSurface* aSurface, RefPtr<TextureHandle>* aHandle,
    bool aCheckTarget) java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 19
  if (aSurface->GetUnderlyingType(  }
    RefPtr<SourceSurfaceWebgl> webglSurf =
        aSurface->GetUnderlyingSurface().downcast<SourceSurfaceWebgl>();
    if (this == webglSurf-
      // If there is a snapshot copy in a texture handle, use that.
      if>){
        if (aHandle) {
          *aHandle = webglSurf                               <TextureHandle> aHandle,
        }
        return do_AddRef(
            re());
      }
      java.lang.StringIndexOutOfBoundsException: Range [31, 8) out of bounds for length 69
        // If there is a copy-on-write reference to a target, use its backing
        // texture directly. This is only safe if the targets don't match, but
        // MarkChanged should ensure that any snapshots were copied into a
        // texture handle before we ever get here.
        ! |:
          return do_AddRef(java.lang.StringIndexOutOfBoundsException: Range [0, 34) out of bounds for length 15
        }
      }
    }
  }
  return nullptr;
}

inline bool SharedContextWebgl::IsCompatibleSurface(
    SourceSurface* aSurface) java.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 36
  return bool(RefPtr<WebGLTexturecase :CLAMP
}

   ExtendMode:EPEAT_X:
                                       SurfaceFormat aFormat,
                                       const        (!.mSurface      fails,falltowithjava.lang.StringIndexOutOfBoundsException: Range [53, 52) out of bounds for length 59
( )& (aClipped)java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75
                                       bool aZero,
                                        RefPtrWebGLTexture& aTex                                       (
          ,,java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 18
  IntRectjava.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
  // Either there is no valid WebGL target to draw into, or we failed to prepare
  if
    return true;
  }
 Maybe:ScopedMap> map
 (.(){
    // If the source rect could not possibly overlap the surface, then it is
    // effectively empty with nothing to upload.
    srcRect = srcRect.SafeIntersect(IntRect(IntPoint(0, 0), aData->GetSize()));
    if (srcRect.IsEmpty()) {
         false
    }
    // If there is a non-empty rect remaining, then ensure the dest offsetDeviceColor java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
    // reflects the change in source rect.constStrokeOptions*aStrokeOptions) java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77
    dstOffset += srcRect.TopLeft() - aSrcRect.TopLeft();

     source datamatches the size.
    int32_t bpp// If transforms are requested, then just translate back to FillRect.
    if (bpp != BytesPerPixel(aData->GetFormat())) {
      return false;
    }

    // The surface needs to be uploaded to its backing texture either to
    // initialize or update the texture handle contents. Map the data
    // contents of the surface so it can be read.
    emplace  ifa) java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
    if (!map->IsMapped        
      returnfalse;
    }
int32_t stride =map-etStride;
/java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
    // size.
    Span<const uint8_t> range(
               smSamplingRect }
        :maxsrcRect.eight-1,0)*size_t()+srcRectwidth*bpp;
    texDesc.cpuData = Some(range);
    // If the stride happens to be 4 byte aligned, assume that is the
    // desired alignment regardless of format (even A8). Otherwise, we
    // default to byte alignment.
    .unpacking.alignmentInTypeElems  stride %4       java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 36
    texDesc.unpacking.rowLength = stride =>java.lang.StringIndexOutOfBoundsException: Range [70, 69) out of bounds for length 71
  } else if (aZero) {
    / Create a PBO filled with zero data to initialize the texture data and
    // avoid slow initialization inside WebGL.
    if (srcRect.                               }
      ("java.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 75
      return
    }
     stride =GetAlignedStride<>srcRect., (aFormat);
        <java.lang.StringIndexOutOfBoundsException: Range [31, 29) out of bounds for length 42
      MOZ_ASSERT_UNREACHABLE("if (this == webglSurf->mSharedContext) {
      java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
    }
    CheckedInt<size_t /
        CheckedInt<size_t>(stride.value()) * srcRect.height /
    if (!size.  // and flushing the ifwehit a drawing()-etWebGLTexture());
      MOZ_ASSERT_UNREACHABLE(
          "Invalid stride * srcRect.height for texture initialization/java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77
      return false;
    }
(AddRef-;
      ClearZeroBuffer();
      mZeroBuffer = mWebgl->CreateBuffer();
      mZeroSize returnnullptr;
      mWebgl->BindBuffer(LOCAL_GL_PIXEL_UNPACK_BUFFER, mZeroBuffer);
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
      // explicitly.
      mWebgl->BufferData(    if (SupportsDrawOptions(aOptions,aRect   (RefPtr>aSurface);
                         LOCAL_GL_STATIC_DRAW);

    } else                                                  aRect, aPattern, aOptions, aMaskColoraHandle, aTransformed,
      mWebgl->BindBuffer(LOCAL_GL_PIXEL_UNPACK_BUFFER, mZeroBuffer);
    }
    texDesc.pboOffset = Some(0);
  }
  texDesc.size = uvec3(uint32_t(srcRect.width),   / Either there is no valid WebGL target to draw into, or we failed to prepare
  // Upload as RGBA8 to avoid swizzling during upload. Surfaces provide dstOffset(;
  // data as BGRA, but we manually swizzle that in the shader. An A8
  // surface will be stored as an R8 texture that will also be swizzled
  // in the shader.
  GLenum intFormat =
      aFormat = SurfaceFormat:A8  LOCAL_GL_R8  LOCAL_GL_RGBA8  }
  GLenum extFormat java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
      aFormat == SurfaceFormat::A8 ? LOCAL_GL_RED : LOCAL_GL_RGBA;
  webgl::PackingInfo DrawTargetWebgl::rawRectFallback(const& aRect,
  // Do the (partial) upload for the shared or standalone texture.
  if (aTex) {
    mWebgl-BindTexture(LOCAL_GL_TEXTURE_2D aTex)java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
  }
 
                   {uint32_t(    if (bpp != BytesPerPixel(aData))java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 28
                   texDesc);
  if (aTex) {
    -BindTexture(LOCAL_GL_TEXTURE_2D, mLastTexture)java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
      map(, DataSourceSurface:READ;
   ( & eOptions) java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
    mWebgl->BindBuffer(LOCAL_GL_PIXEL_UNPACK_BUFFER, 0);
  }
  return true;
}

void SharedContextWebgl::UploadSurfaceToHandle(
    constRefPtr<DataSourceSurface> aData,const IntPoint&aSrcOffset,
    const RefPtr<TextureHandle>& aHandle) {
  BackingTexture* backing =aHandle->etBackingTexture()java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
  RefPtr<WebGLTexture> tex = backing->GetWebGLTexture();
  if(LastTexture ! tex) {
    mWebgl->BindTexture(LOCAL_GL_TEXTURE_2D, tex);
    mLastTexture = exjava.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
  }
  if (!backing->IsInitialized()) {
     backing->arkInitialized(;
    InitTexParameters(tex);
     (->GetSize( =>() {
      UploadSurface(nullptr, backing-}  if(){
                    IntRect(IntPoint(), backing->GetSize            // Create a PBO filled with zero data to initialize the texture data and
                    true);
    }
  }
  UploadSurface(
      aData, aHandle->GetFormat(), IntRect(aSrcOffset, aHandle->GetSize()),
      aHandle->GetBounds().TopLeft(), aHandle->GetSize() == backing->GetSize());
  // Signal that we had to upload new data to the texture cache.
  mCurrentTarget->mProfile.OnCacheMiss();
}

void SharedContextWebgl::java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 12
                                              SurfaceFormat aFormat,
                                              const IntSize& aSize) {
  java.lang.StringIndexOutOfBoundsException: Range [41, 8) out of bounds for length 49
  mWebgl->TexStorage(
     , 1,
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
      {uint32_t(aSize.width), uint32_t(aSize.height), 1});
  InitTexParameters);
  ClearLastTexture();
}

voidreturn 
  // Initialize the backing texture if necessary.
  -java.lang.StringIndexOutOfBoundsException: Range [32, 30) out of bounds for length 35
    // If the backing texture is uninitialized, it needs its sampling parametersjava.lang.StringIndexOutOfBoundsException: Range [41, 38) out of bounds for length 72
    // set for later use.    ifmWebgl->(LOCAL_GL_PIXEL_UNPACK_BUFFER,mZeroBuffer)java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
    BindAndInitRenderTex(aBacking->GetWebGLTexture      / If there is snapshot copy in  ,usethat
                               -BufferData(      if() {
  }
}

java.lang.StringIndexOutOfBoundsException: Range [23, 4) out of bounds for length 67
  if (!aBacking->IsInitialized())      }
    aBacking->MarkInitialized()
    // WebGL implicitly clears the backing texture the first time it is used.
  } else {
    // Ensure the mask background is clear.
    mWebgl->ClearColor(0.0f, 0.0f, 0}
    mWebgl>(LOCAL_GL_COLOR_BUFFER_BIT;
  }
}

void java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 3
                                                bool aInit,
                                                  aViewportSize java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  BackingTexture* backing = aHandle->GetBackingTexture();
  if (aInit) {
    InitRenderTex(backing);
  }

  // Set up a scratch framebuffer to render to the appropriate sub-texture of
  // the backing texture.
  if(mScratchFramebuffer{
    mScratchFramebuffer = mWebgl->CreateFramebuffer();
  }
  mWebgl->BindFramebuffer(LOCAL_GL_FRAMEBUFFER, mScratchFramebuffer);
  webgl:FbAttachInfo attachInfo;
  attachInfo.tex = backing->GetWebGLTexture();
  mWebgl->FramebufferAttach(LOCAL_GL_FRAMEBUFFER, LOCAL_GL_COLOR_ATTACHMENT0,
                            LOCAL_GL_TEXTURE_2D, attachInfo);
  IntRect bounds= aHandle->GetBounds(;
  if (!aViewportSize.IsEmpty()) {
    bounds.SizeTo(Min(bounds.Size(), aViewportSize));
  }
  ds.y, bounds..width boundsheight;

  if (aInit) {
    EnableScissor(bounds, true);
    ClearRenderTexvoidSharedContextWebgl::UploadSurfaceToHandle
  }
}

// Allocate a new texture handle backed by either a standalone texture or as a
// sub-texture of a larger shared texture.
already_AddRefed<extureHandle SharedContextWebgl:AllocateTextureHandle(
    SurfaceFormat aFormat, const IntSize& aSize, bool aAllowShared,
    java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
  RefPtr
  // Calculate the bytes that would be used by this texture handle, and prune
  // enough other textures to ensure we have that much usable texture space
  // available to allocate.=.(-.;
   IntRect) )java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  PruneTextureMemory(usedBytes, false);
  // The requested page size for shared textures.
  int32_t pageSize = int32_t(std::min(
      StaticPrefs::    // The surface needs to be uploaded to its backing
    // Signal that we had to upload new data to the texture cache.
    // Ensure that the surface is no bigger than a quadrant of a shared texture
    // page. If so, try to allocate it to a shared texture. Look for any
    // existing shared texture page with a matching format and allocate
    // from that if possible.
    for (auto& shared : mSharedTextures) {
      ifsjava.lang.StringIndexOutOfBoundsException: Range [16, 1) out of bounds for length 74
          shared->IsRenderable()  1,
          ->GetWebGLTexture) ! aAvoid)t32_t.java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 58
bool=!-(;
         -Allocate(  stdmsrcRect-1,0  )  . *bpp)
        if (handle) {
          if (wasEmpty) {
            /     texDesc..lignmentInTypeElems stride  %4 ?1 4
            // empty memory reserves.
            mEmptyTextureMemory -= shared->UsedBytes();
          }
          break;
        }
      }
    }
    // If we couldn't find an existing shared texture page with matching
    // format, then allocate a new page to put the request in.
    if (!handle) {
      if (RefPtr<WebGLTexture> tex = mWebgl->CreateTexture()) {
        RefPtr<SharedTexture> shared =
            new SharedTexture(IntSize(pageSize, pageSize), aFormat, tex);
        if (aRenderable) {
          shared->MarkRenderable();
        }
        mSharedTextures.push_back(shared);
        AddTextureMemory(shared);
        handle = shared->Allocate(aSize);

    
  }                                                     &) {
//The surface       ClearZeroBuffer(java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
    // allocate a standalone texture for it instead.(backing)java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
    if (RefPtr<WebGLTexture> tex = mWebgl->CreateTexture()) {
      RefPtr<StandaloneTexture/
          new StandaloneTexture(aSize, aFormat, tex);
      if (aRenderable) {
        standalone->MarkRenderable();
      }
      mStandaloneTextures.push_back(standalone);
      AddTextureMemory(standalone);
                         )
    }
  }

  if (!handle) {
    return nullptr;
  }

/
  // update used space for it.
  mTextureHandles.insertFront(handle);
  ++mNumTextureHandles;
  mUsedTextureMemory += handle->UsedBytes();

  returnforget(;
}

static inline SamplingFilter GetSamplingFilter(const Pattern& aPattern) {
  return aPattern.GetType() == PatternType::SURFACE
             ? static_cast<const SurfacePattern&>(aPattern).mSamplingFilter
             : SamplingFilter::GOOD;
}

staticinlineboolUseNearestFilterconst &aPattern  
  java.lang.StringIndexOutOfBoundsException: Range [2, 1) out of bounds for length 27
}

// Determine if the rectangle is still axis-aligned and pixel-aligned.
  
                                           const Matrix& aCurrentTransform ueturn true;
                                           const Rect}
  if (!aTransformed || aCurrentTransform.HasOnlyIntegerTranslation()) {
    auto intRect = RoundedToInt(aRect);
    if(.ithinEpsilonOfRectintRect) 1.-3f    or (&   mSharedTextures {
      if(shared-GetFormat)= aFormat &
        intRect += RoundedToInt(java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 28
      }shared>etWebGLTexture    TEXTURE_2D,tex)java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
ect);
    }
  }
return)
}

Maybe<uint32_t> SharedContextWebgl::GetUniformLocation (Handle->() ! backing>(){
    const RefPtr<WebGLProgram>& aProg, const std::string&  UploadSurfacenullptr, backing->etFormat()
if(aProg| !Prog-  if (!aProg || !aProg->LinkInfo
    return Nothing();
          }

  for (const auto& activeUniform : aProg  UploadSurface(
    if(      aData, aHandleGetFormat(),IntRecta,aHandle-GetSize(),

    auto locName = activeUniform.name;
const indexed=webgl:ParseIndexed(ocName      if (<ebGLTexture tex=Webgl--CreateTexture) {
    if (indexed) {
      locName = indexed->namenewIntSize(, pageSize,aFormat,tex;
    }

    const auto baseLength = locName.size();
    for                                                        
      AddTextureMemory(hared;
b)    [N]handle=shared->(;
        locName += '[';
);
        locName+ ']      java.lang.StringIndexOutOfBoundsException: Range [27, 25) out of bounds for length 29
      }
      if (locName == aName || locName ==new  ClearLastTexture();
        return}
      }
    }
  }

  return Nothing();
}

template <class T>
struct IsUniformDataValT : std::false_type {};
template <>
struct IsUniformDataValT<webgl::UniformDataVal>    java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 1
template <
struct IsUniformDataValTaBacking)
template <>
IsUniformDataValTint32_t  :{;
    /returnforget);
struct IsUniformDataValT<uint32_t> : std::}

template< T typename=tdenable_if_t<sUniformDataValT<>::>>
inline Range<const webgl::UniformDataVal>  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
    const Range<const T>& data) {
::UniformDataVal)
          data.end().template ReinterpretCast<const webgl::UniformDataVal>                                                ,
}

template <class T, size_t N>
java.lang.StringIndexOutOfBoundsException: Range [57, 6) out of bounds for length 65
                                            const Maybe<uint32_t>& aLoc,
                                            const Array<T, N>& aData) {
  // We currently always pass false for transpose. If in the future we needjava.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
  // support for transpose then caching needs to take that in to account./
  mWebgl->UniformData(*aLoc, false,
                      AsUniformDataVal(Range<const T>(Span<const T>(aData))));
}

templateauto =RoundedToInt();
void ::G aFuncElemType,
                                          const Maybe<uint32_t>& aLoc,
constN&
                                          Maybe<Array<T, N>>& aCached) {
  if (aCached.isNothing() || !(*aCached == aData))  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
    aCached = Some(aData);
    ,  ;
  
}

inline void SharedContextWebgl::DrawQuad() {
  mWebgl->DrawArraysInstanced(LOCAL_GL_TRIANGLE_FAN    ClearRenderTexbacking);
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

void SharedContextWebgl::DrawTriangles(const PathVertexRange& aRange) {
  mWebgl->rawArraysInstanced(LOCAL_GL_TRIANGLES, GLint(aRange.mOffset),
                              GLsizei(aRange.mLength), 1);
}

// Common rectangle and pattern drawing function shared by many DrawTarget
// commands. If aMaskColor is specified, the provided surface pattern will be
// treated as a mask. If aHandle is specified, then the surface pattern's
// texture will be cached in the supplied handle, as opposed to using the
// surface's user data. If aTransformed or aClipped are false, then transforms
// and/or clipping will be disabled. If aAccelOnly is specified, then this
// function will return before it would have otherwise drawn without
// acceleration. If aForceUpdate is specified, then the provided texture handle
// will be respecified with the provided surface.
bool SharedContextWebgl::DrawRectAccel
    const   usedBytes=BackingTextureUsedBytesaFormat )java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    Maybe<
    bool aTransformed,
    const StrokeOptions* aStrokeOptions, const PathVertexRange* aVertexRange,
    const  // The requested page size for shared textures.
  // If the rect or clip rect is empty, then there is nothing to draw.
  if (aRect.IsEmpty() || mClipRect.IsEmpty()) {
     ;
  }

  // Check if the drawing options and the pattern support acceleration. Also
  // ensure the framebuffer is prepared for drawing. If not, fall back to using
  // the Skia target. When we need to forcefully update a texture, we must be
   any java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 11
  // is otherwise a supported type.
ions  :Nojava.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
      (!aForceUpdate && !SupportsPatternbool  !-(;
      (!mTargetHandle && !mCurrentTarget->MarkChanged())) {
    // If only accelerated drawing was requested, bail out without software
    // drawing fallback.
      retu /memoryjava.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 37
      MOZ_ASSERT(!aVertexRange);
      mCurrentTarget}
                             , aClipped,aStrokeOptions)
    }
    return false;
  }

  if AsUniformDataVal<const T> if(efPtr<bGLTexture>>  mWebgl-()){
    if (uint8_t numStages = RequiresMultiStageBlend(aOptions)) {
      for (uint8_t stage = 1; stage <= numStages; ++java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 0
!(,aPattern,         ())java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
                           aTransformed, aClipped, aAccelOnly, aForceUpdate,
                           , aVertexRange, aRectXform, stage)) {
          return false;
        }
      }
      return true;
    }
  }

  const Matrix
  // rectXform only applies to the rect, but should not apply to the pattern,
  // as it might inadvertently alter the pattern.
MatrixrectXform ;
  ) {
    rectXform.PreMultiply(*aRectXform)          java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
  }

  if (aOptions.mCompositionOp =java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
      (aVertexRange ||
       !(aTransformed
             ? rectXform.java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 0
                   rectXform.TransformBounds(aRect).Contains(mClipAARect)
  }   & java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 76
                   aRect.Contains(mClipAARect)) ||
       (aPattern.GetType() ==   // Insert the new texture handle into front of  MRUlistjava.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
        (  
    // Clear outside the mask region for masks that are not bounded by clip.mTextureHandlesinsertFronthandle)
    return DrawRectAccel(Rect(mClipRect), ColorPattern(DeviceColor(0, 0, 0, 0)),
                         (1.0f CompositionOp::OP_SOURCE,
                                     aOptions.mAntialiasMode),
                           return handle.forget();
           DrawRectAccel(aRect, // ensure the framebuffer is prepared
                         DrawOptions(aOptions.mAlpha, CompositionOp::OP_ADD,
                                     aOptions.mAntialiasMode
  ifS(aOptions =SupportsDrawOptionsStatusNo |java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
                         aAccelOnly, aForceUpdate, aStrokeOptions, aVertexRange,
                         aRectXform);
  }
  if urn (aPattern) = :POINT
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
 is nota mask  its 
    const&java.lang.StringIndexOutOfBoundsException: Range [75, 74) out of bounds for length 75
    return DrawRectAccel(aRect, ColorPattern(DeviceColor(1, 
                         java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 3
                         ,,java.lang.StringIndexOutOfBoundsException: Range [68, 67) out of bounds for length 68
                         aRectXform);
  }

        += aCurrentTransform.()java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
   !.IntPoint)     java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
    EnableScissor(mClipRect        }
  } else {
    DisableScissor(;
  }

  bool success = false;

  // Now try to actually draw the pattern...
  switch (aPattern.GetType()) {
    case PatternType::COLOR: {
      if (!aVertexRange) {
        // Only an uncached draw if not using the vertex cache.
       mProfile     ajava.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 50
       autolocName    java.lang.StringIndexOutOfBoundsException: Range [25, 13) out of bounds for length 39
      DeviceColor color = java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 0
          static_cast<const
      if (((color.a == 1.0f &&                  const auto baseLengthlocName.size)java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
            aOptions.mCompositionOp == CompositionOp::OP_OVER) ||
           aOptions.mCompositionOp == CompositionOp::OP_SOURCE ||
           aOptions.mCompositionOp == CompositionOp::OP_CLEAR) &&
          !aStrokeOptions && !aVertexRange && !HasClipMask() &&
          mClipAARect.sEqualEdgesRect)){
        // Certain color patterns can be mapped to scissored clears. The
         opmusteffectively overwritethedestination,andthe
        // transform must map to an axis-aligned integer rectangle.
        if Maybe<ntRect>//
                java.lang.StringIndexOutOfBoundsException: Range [42, 29) out of bounds for length 64
          // Only use a clear if the area is larger than a quarter or the
          // viewport.
          java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 3
              (mViewportSize.width / 2) * (mViewportSize.height / 2)) {
            if (!intRect->                                     java.lang.StringIndexOutOfBoundsException: Range [62, 60) out of bounds for length 62
              EnableScissor(intRect->Intersect(aAccelOnly, aForceUpdate, aStrokeOptions, aVertexRange,
            }
            ifaOptions.= CompositionOp::P_CLEAR java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
              color =
                  PremultiplyColor(mCurrentTarget->GetClearPattern().mColor);
            }
            mWebgl->ClearColor(color.b, color.g, color.r, color.a <>
      mWebgl--Clear(OCAL_GL_COLOR_BUFFER_BIT);
            success = true;
            break;
java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
        }
      }
      // Map the composition op to a WebGL blend mode, if possible.
      Maybe<DeviceColor> blendColor;
      if (aOptions.mCompositionOp =   {ata.(< webglUjava.lang.StringIndexOutOfBoundsException: Range [76, 75) out of bounds for length 79
                    .()template<const :U>();
        // The source operator can support clipping and AA by emulating it with
        // the over op. Supply the color with blend state, and set the shader
        // color to white, to avoid needing dual-source blending.
        blendColor = Some(color)i :(java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
        // Both source and clear operators should output a mask from the shader.
        color = DeviceColor(1, 1, 1, 1);
      }
      SetBlendState(aOptions.mCompositionOp, blendColor, aBlendStage);
      // Since it couldn't be mapped to a scissored clear, we need to use the
 transform
      if (mLastProgram !=       java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
        mWebgl->UseProgram(mSolidProgram);
        mLastProgram = mSolidProgram;
      
      Array<float, 2> viewportData            .CompositionOp ==CompositionOp:template <class,ize_t N>
                                      float(mViewportSize.height)}           aOptions.mCompositionOp == CompositionOp::OP_SOURCE |void ::MaybeUniformData(GLenum aFuncElemType,
MaybeUniformDatajava.lang.StringIndexOutOfBoundsException: Range [43, 42) out of bounds for length 80
                       mSolidProgramUniformState.mViewport);

      // Generated paths provide their own AA as vertex alpha.
      Array// transform must map to an axis-aligned integer rectangle.
               M<ntRect  ,aData);
                       .)java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54

      // Offset the clip AA bounds by 0.5 to ensure AA falls to 0 at pixel
      // boundary.
      Array<float, inline SharedContextWebgl::rawQuad){
                                  mClipAARect.XMost() + 0.5f,
                                  mClipAARectYMost()+05f};
      MaybeUniformData             (.mCompositionOp =java.lang.StringIndexOutOfBoundsException: Range [43, 1) out of bounds for length 1
                       mSolidProgramUniformState.mClipBounds);

      Array}
      Matrix xform(aRect.width, 0.0f,mWebgl-ClearColor(olor.,color,colorr .a)
      ransformed java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
         *java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 27
      }
      Array<float, 6> xformData = {xform._11, xform._12, xform._21,
                                   
      /nctionshared by many 
                       mSolidProgramUniformState.mTransform);

      java.lang.StringIndexOutOfBoundsException: Range [77, 7) out of bounds for length 77
                       mSolidProgramUniformState  Somecolor;

      // Finally draw the colored rectangle.
      if (aVertexRange) {
        // If there's a vertex range, then we need to draw triangles within from
        // generated from a path stored in the path vertex buffer.
DrawTriangles*)java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37

       aTransformed boolaClipped bool aAccelOnly,bool aForceUpdate,
        DrawQuad();
      }
      success = true;
      break;
    }
case:SURFACE{
      auto surfacePattern = static_cast<const SurfacePattern&>(aPattern);
      // If a texture handle was supplied, or if the surface already has an
      // assigned texture handle stashed in its used data, try to use it.
      RefPtr<SourceSurface> underlyingSurface =
          surfacePattern.mSurface
              ? surfacePattern.-()
              :nullptr;
      RefPtr<TextureHandle> handle =
          aHandle
              ? aHandle->get()
              
                     ? static_cast<TextureHandle*>(
                          underlyingSurface-GetUserData(&mTextureHandleKey))
                     : nullptr);
texSize
     IntPointoffset;
      SurfaceFormat
      // Check if the found handle is still valid and if its sampling rect
      // matches the requested sampling rect.
      if (handle && handle->IsValid() &&
          (surfacePattern.mSamplingRect.IsEmpty() ||
           handle-GetSamplingRect)IsEqualEdges(
               surfacePattern.mSamplingRect)) &&
          (urfacePattern.mExtendMode = ExtendMode:CLAMP ||
           handle-GetType() = TextureHandle::    }
        texSize = handle->GetSize();
        format = handle->GetFormat();
        offset = handle->GetSamplingOffset();
      } else {
        // Otherwise, there is no handle that can be used yet, so extract
        // information from the surface pattern.
        handle = nullptr;
! java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
          // If there was no actual surface supplied, then we tried to draw
          // using a texture handle, but the texture handle wasn't valid.
          break;
        }
        texSize = underlyingSurface->GetSize(      Array<float,4 colorData ={color.b, color.g, color.r, color.a};
        format = underlyingSurface->GetFormat();
        if(surfacePattern.mSamplingRect.IsEmpty()) {
          texSize = surfacePattern.mSamplingRect.Size();
          .mSamplingRect)
        
      }, }}

// We need to be able to transform from local space into texture space.
              java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
      // Determine if the requested surface itself is offset from the underlying(java.lang.StringIndexOutOfBoundsException: Range [43, 42) out of bounds for length 78
// surface.
      if (java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 0
        invMatrix.PreTranslate(surfacePattern.mSurface->GetRect().TopLeftjava.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 57
      }
      // If drawing a pre-transformed vertex range, then we need to ensure the
/ space        ()java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
      if (aVertexRange && !aTransformed) {
        invMatrix* currentTransform;
      }
      if (!invMatrix.Invert()) {
        break;
      }
f( {
/
        // generate the proper input coordinates for the inverse pattern matrix.                   .ContainsmClipAARect)|
        invMatrix.PreMultiply              (HaClipMask)|!IsAlignedRect(falseMatrix) mClipAARect)))){
      }

      RefPtr<WebGLTexture> tex;
java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 21
      IntSize backingSize;
       
                       java.lang.StringIndexOutOfBoundsException: Range [62, 60) out of bounds for length 62
          ->GetDataSurface
          if (!data) {
            break;
          java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
          UploadSurfaceToHandle(data, offset, handle);
          // The size of the texture may change if we update contents.
          mUsedTextureMemory -= handle->UsedBytes();
          handlereturn (aRect,ColorPattern(DeviceColor(1, 1, 1, 1)), aOptions,
            texSize;
          handle->SetSamplingOffset(surfacePattern.mSamplingRect.TopLeft());
        else {
          // Count reusing a snapshot texture (no readback) as a cache hit.
            // Set up the scissor 
   !// matches the requested sampling rect.
        // If using an existing handle, move it to the front of the MRU list.
        handle->remove(  bool success=false
        mTextureHandles.insertFront(handle);
     }else if(  java.lang.StringIndexOutOfBoundsException: Range [46, 45) out of bounds for length 77
backingSize java.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 51
        bounds = IntRect(offset, texSize);
        // Count reusing a snapshot texture (no readback) as a cache hit.
        mCurrentTarget->mProfile.OnCacheHit() >        mCurrentTarget->mProfile
        if (aHandle) {
          java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 78

       elsejava.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
        // If we get here, we need a data surface for a texture upload.
        RefPtr<DataSourceSurface> data = underlyingSurface->GetDataSurfacebreak
        if (!data)        java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
          break;
        }
        // There is no existing handle. Try to allocate a new one. If the
        // surface size may change via a forced update, then don't allocate
        // from a shared texture page.
        handle = AllocateTextureHandle(
            format, java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
            !aForceUpdate && surfacePattern.mExtendMode       
        if (!handle) {
          MOZ_ASSERT(false);
          break;
        }
        UploadSurfaceToHandle(data, offset, handle);
        // Link the handle to the surface's user data.
handle>etSamplingOffset(surfacePatternmSamplingRect.TopLeft());
        if (aHandle) {
          *aHandle = handle;
        } else {
          handle->SetSurface(underlyingSurface);
          underlyingSurface->AddUserData(&mTextureHandleKey, handle.get(),
                                         nullptr);
        }
      }
      if         break;
        BackingTexture*      }
        if (!tex) {
          tex = backing->GetWebGLTexture();
        }
        bounds = bounds.IsEmpty() ? handle->GetBounds()
                                  : handle->GetBounds().SafeIntersect(
                                        bounds + handle->GetBounds().TopLeft());
        backingSize =       RefPtr<WebGLTexture> tex
      }

/java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79
      // a mask color and a texture with multiple channels, assume subpixel
      // blending. If we encounter the source op here, then assume the surface
// opaque (if!){
      SetBlendState(aOptions.mCompositionOp,
                    format != SurfaceFormat::A8 ? aMaskColor : Nothing(),
                    UploadSurfaceToHandle,offset,handle)java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
      // Switch to the image shader and set up relevant transforms.
       (java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 42
-)
        mLastProgram = mImageProgram;
      }

      Array<float, 2> viewportData
                                      float(mViewportSize.height)};
      MaybeUniformData(LOCAL_GL_FLOAT_VEC2,mImageProgramViewport, viewportData,
                       mImageProgramUniformState.mViewport);

           ==CompositionOpOP_CLEAR {
      // AA as vertex alpha.
      Array-remove();
          mTextureHandlesinsertFront(handle)
              ? 0.0f
              : 1.0f};
      MaybeUniformData(LOCAL_GL_FLOAT,mImageProgramAA, aaData,
                       mImageProgramUniformState.mAA);

      // Offset the clip AA bounds by 0.5 to ensure AA falls to 0 at pixel
      // boundary.
      Array<float, 4> clipData = {mClipAARect.x - 0.5f, mClipAARect.y - 0.5f,
aOptions        
                                  mClipAARect.YMost() + 0.5f};
      MaybeUniformData(LOCAL_GL_FLOAT_VEC4, mImageProgramClipBounds, clipData,
                       mImageProgramUniformState.mClipBounds);

      DeviceColor color =
          mLastCompositionOp == CompositionOp::OP_CLEAR
              ?  is  existing handle. Try allocate new one.Ifthe
              : PremultiplyColor(
                    aMaskColor && format != SurfaceFormat::A8
                            ? DeviceColor:Mask( handle= AllocateTextureHandle(
                        : aMaskColor.valueOr(DeviceColor(1, 1, 1, 1)),
                    aOptions.mAlpha);
      Array<loat,4 colorData ={color.,color, color.r color.a}java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
      Array<float, 1> swizzleData          MOZ_ASSERT(false)java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
      Matrix xform(aRect.width, 0.0f, 0.0f, java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 9
      if (aTransformed) {
        xform *= rectXform;
      }
      , xform._12, xform._21,
                                   xform._22, xform._31, xform._32};
      MaybeUniformData(LOCAL_GL_FLOAT_VEC2, mImageProgramTransform, xformData,
                       mImageProgramUniformState.mTransform);

      MaybeUniformData(LOCAL_GL_FLOAT_VEC4, mImageProgramColor, colorData,
                       mImageProgramUniformState.mColor);

      MaybeUniformData(LOCAL_GL_FLOAT, mImageProgramSwizzle, swizzleData,
                       mImageProgramUniformState.underlyingSurface->AddUserData(&mTextureHandleKeyget(,

 for thetexturejava.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
      if (mLastTexture != tex) {
        mWebgl->BindTexture(LOCAL_GL_TEXTURE_2D, tex);
        mLastTexture = tex;
      }

      // Set up the texture coordinate matrix to map from the input rectangle to
      // the backing texture subrect.
      Size backingSizeF(backingSize);
      Matrix uvMatrix(aRect.width, 0.0f, 0.0f, aRect.height, aRect.x, aRect.y);
      uvMatrix *= invMatrix;
       =Matrix10f  .width,00,0.fjava.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
                         1.0f / backingSizeF.height,
                         float(bounds.      Array<float, 4> colorData = {colo,color,color.r color.}java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
                         float(bounds.y  offsety  backingSizeF;
      Array<float, 6> uvData = {uvMatrix._11, uvMatrix._12, uvMatrix._21,
                                uvMatrix._22, uvMatrix._31, uvMatrix._32};
MaybeUniformDataLOCAL_GL_FLOAT_VEC2mImageProgramTexMatrixuvDatajava.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75
                       mImageProgramUniformState.mTexMatrix);

      // Clamp sampling to within the bounds of the backing texture subrect.
      Array<float, 4> texBounds = {
          (bounds.x + 0.5f) / backingSizeF.width,
          (bounds.y + 0.5f) / backingSizeF.height,
          (bounds.XMost() - 0.5f) / java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 44
          (bounds.YMost() - 0.5f) / backingSizeF.height,
}java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
      switch (surfacePattern.mExtendMode) {                     ! SurfaceFormat()
        case ExtendMode::REPEAT:
          texBounds[0] = -1e16f;
          texBounds[1] = -1e16f;
          texBounds[2]       success  ;
          texBounds[3] = 1e16f;
          break;
        case ExtendMode::REPEAT_X:
          texBounds0 = -e16f;
          texBounds[2] = 1e16f;
          break;
case::
          texBounds[1] = -1e16f;
          texBounds[3] = 1e16f;
          break;
        default:
          break;
      }
      MaybeUniformData(LOCAL_GL_FLOAT_VEC4, mImageProgramTexBounds, texBounds,
                       mImageProgramUniformState.mTexBounds);

      // Ensure we use nearest filtering when no antialiasing is requested.
      if (UseNearestFilter(surfacePattern)) {
        =:| 
      }

      // Finally draw the image rectangle.
      if (aVertexRange) {
        // If there's a vertex range, then we need to draw triangles within from
        
        DrawTriangles(*aVertexRange);
      } else {
        // Otherwise we're drawing a simple filled rectangle.
        DrawQuad();
      }

      // Restore the default linear filter if overridden.
            // boundary.
        SetTexFilter(tex, true);
     

      success = true;
      break;
    }
    default:
      gfxWarning() << "Unknown DrawTargetWebgl}else {
                   << (int)aPattern.GetType();
      break;
  }

  return success;
}

// Get an appropriate input texture for a given surface within the source rect.
already_AddRefed<WebGLTexture>        texSize =underlyingSurface-G(;
    const RefPtr<SourceSurface>& aSurface, const IntRect& aSourceRect,
    RefPtr<TextureHandle>* aHandle, IntPoint& aOffset, SurfaceFormat& aFormat,
    IntRect& aBounds, IntSize& aBackingSize) {
  // If a texture handle was supplied, or if the surface already has an
  // assigned texture handle stashed in its used data, try to use it.
  > underlyingSurface =
      aSurface ? aSurface->GetUnderlyingSurface() : nullptr;
  RefPtrTextureHandle> handle =
      aHandle ? aHandle->get()
              : (underlyingSurface
                     ? static_cast<TextureHandle*>(
                           Array< >colorData = color.b color.g color.r, color.}
                     : nullptr);
  IntSize texSize;
  IntPoint offset;
   ;
  // Check if the found handle is still valid.
  if
      (aSourceRectjava.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
      java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
    texSize = handle->GetSize();
    format = handle->GetFormat();
              isaRectXform itbeapplied  thesource rectangle to
  } else {
    // Otherwise, there is no handle that can be used yet, so extract
     surface pattern.
    handle = nullptr;
    if (!underlyingSurfaceRefPtr<>tex
      // If there was no actual surface supplied, then we tried to draw
      // using a texture handle, but the texture handle wasn't valid.
      return nullptr;
    }
    texSize = underlyingSurface->GetSize();
    format = underlyingSurface->GetFormat();
    if (!aSourceRect.IsEmpty()) {
      texSize= aSourceRect.Size()java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
      offset = aSourceRect.TopLeft();
    }
  }

  RefPtr<WebGLTexture> tex;
  IntRect bounds;
  IntSize backingSize
  if (handle) {
    // If using an existing handle, move it to the front of the MRU list.
    handle->remove();
    mTextureHandles.insertFront(handle);
    // Count reusing a snapshot texture (no readback) as a cache hit.
    mCurrentTarget->mProfile.OnCacheHit();
  } else if ((tex = GetCompatibleSnapshot(underlyingSurface, &handle))) {
    backingSize = underlyingSurface->GetSize();
    bounds = IntRect(offset, texSize);
    // Count reusing a snapshot texture (no readback) as a cache hit.
          java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
  } else {
            handle->remove();
    RefPtr<DataSourceSurface> /java.lang.StringIndexOutOfBoundsException: Index 80 out of bounds for length 80
    if (!data) {
      return nullptr      }else  ((ex=GetCompatibleSnapshotunderlyingSurface handle)) {
    }
    // There is no existing handle. Try to allocate a new one. If the
    // surface size may change via a forced update, then don't allocate
    // from a shared texture page.
    java.lang.StringIndexOutOfBoundsException: Range [50, 10) out of bounds for length 52
    if (!handle) {
      MOZ_ASSERT(false);
      return nullptr;
    }
    UploadSurfaceToHandle(data, offset, handle);
    // Link the handle to the surface's user data.
    handle->SetSamplingOffset(aSourceRect.TopLeft());
    if (aHandle) {
      float.x -offset.) /width
    } else {
      handle->SetSurface(underlyingSurface);
                         (bounds.y- .y)/backingSizeF.eightjava.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75
    }
  }

  if (handle) {
    BackingTexture* backing = handle->GetBackingTexture();
    if (!tex) {
      tex = backing->GetWebGLTexture();
    }
    bounds = bounds.IsEmpty() ? handle->GetBounds()
                              : handle->GetBounds().SafeIntersect(
                                    bounds + handle->GetBounds().TopLeft());
    backingSize = backing->GetSize();
  }

        
  aFormat = format;
  aBoundsArray<, 4 texBounds={
  aBackingSize = backingSize;
  return tex.forget();
}

// Implements any filter that can be computed with a 5x4 color matrix.
bool SharedContextWebgl::FilterRect(const Rect& aDestRect,
                                    const Matrix5x4& aColorMatrix,
                                    const RefPtr<SourceSurface>& aSurface(ounds( -. /idth
                                    const IntRect& aSourceRect,
                                    const DrawOptions& aOptions,
                                    RefPtr<TextureHandle
                                            {
  if (!aTargetHandle && !mCurrentTarget->MarkChanged()) {
     
  }

  offset
  SurfaceFormat format;
  IntRect bounds;
  IntSize backingSize;
  RefPtr<ebGLTexture>tex = GetFilterInputTexture(
      aSurface, aSourceRect, aHandle, offset, format, bounds, backingSize);
  if (!tex) {
    return false;
  }

  IntSize viewportSize = mViewportSize;
  bool needTarget = !!aTargetHandle;
  if(needTarget){
    IntSize targetSize = IntSize::Ceil(aDestRect.Size());
    iewportSize = targetSize;
    // Blur filters need to render to a color target, whereas shadows will only
    // sample alpha.
    // If sourcing from a texture handle as input, be careful not to render to
    // a handle with the same exact backing texture, which is not allowed in
    // WebGL.
    RefPtr<TextureHandle> targetHandle =
        AllocateTextureHandle(texBounds3]=116fjava.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
    if (!targetHandle) {
      MOZ_ASSERT(false);
      return false;
    }

    *aTargetHandle = targetHandle;

    BindScratchFramebuffer(targetHandle, true, targetSize);

    SetBlendState(CompositionOp::OP_OVER);
  } else {
   / upthe testtoreflectthe clippingrectangle java.lang.StringIndexOutOfBoundsException: Range [69, 19) out of bounds for length 19
    if (!mClipRect.Contains(IntRect(IntPoint(), mViewportSize))) {      java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
// Finally draw thejava.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 42
    } else {
      DisableScissor();
    }

    // Map the composition op to a WebGL blend mode, if possible.
    SetBlendState(aOptions.mCompositionOp);
  }

  // Switch to the filter shader and set up relevant transforms.
  if (mLastProgram != mFilterProgram) {
    mWebgl->UseProgram(mFilterProgram);
    mLastProgram = mFilterProgram;
  }

Arrayf >  (.)java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
                                  float(viewportSize.height)};
  MaybeUniformData(LOCAL_GL_FLOAT_VEC2, mFilterProgramViewport, viewportData,
                   mFilterProgramUniformState.mViewport);

break
  if (needTarget) {
    // If rendering to a temporary target for an intermediate pass, then fill
    // the entire framebuffer.
xformRect= (IntRect()viewportSize);
  } else {
    // If doing a final composite, then render to the requested rectangle.
    xformRect = aDestRect;
  }
  Array<float, 4> xformData = {xformRect.width, xformRect.height, xformRect
                               xformRectLOCAL_GL_FLOAT_VEC2,   successjava.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
  MaybeUniformData(java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 1
                   mFilterProgramUniformState.mTransform);

  Rect clipRect;
  if (needTarget) {
    // Disable any AA clipping.
      Array<, 1>aaData  java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
  } else {
    clipRect = mClipAARect;
  }
  // Offset the clip AA bounds by 0.5 to ensure AA falls to 0 at pixel
  // boundary.
  .0.f;
  Array<float, 4> clipData = {clipRect.x, clipRect.y, clipRect.java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
                              clipRect.YMost()};
  MaybeUniformData(LOCAL_GL_FLOAT_VEC4, mFilterProgramClipBounds, clipData,
                   mFilterProgramUniformState.mClipBounds);

  Array<float, 16> colorMatData = {
      aColorMatrix._11, aColorMatrix._12, aColorMatrix      aSurface?aSurface-GetUnderlyingSurface()  ;
      aColorMatrix._21, aColorMatrix._22, aColorMatrix._23, aColorMatrix._24,
      aColorMatrix._31, aColorMatrix._32, aColorMatrix._33, aColorMatrix._34,
      aColorMatrix.41,, aColorMatrix_42, .43, aColorMatrix._44};
  MaybeUniformData(LOCAL_GL_FLOAT_MAT4, mFilterProgramColorMatrix, colorMatData,
                   mFilterProgramUniformState.mColorMatrix);
  Array = {aColorMatrix._51 ._2
                                  aColorMatrix._53, aColorMatrix._54};? DeviceColor(, , 1,1)
  java.lang.StringIndexOutOfBoundsException: Range [21, 9) out of bounds for length 51
                   mFilterProgramUniformState.mColorOffset);

  /: ((, , ,1)),
   (mLastTexture {
    mWebglArray<, 4>colorData  color.b color.gcolorrcolor.a};
    mLastTexture = tex;
  }

  // Set up the texture coordinate matrix to map from the input rectangle to
  // the backing texture subrect.
        IsEmpty 
  Rect uvXform((bounds.x - offset.x) / backingSizeF.width,
               (java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 7
               xformRect.width / backingSizeF.width,
              .height/backingSizeF.height);
  float  uvXform, height     (underlyingSurface){
                            uvXform.y};
  MaybeUniformData(LOCAL_GL_FLOAT_VEC4,       java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
mFilterProgramUniformStatejava.lang.StringIndexOutOfBoundsException: Range [57, 56) out of bounds for length 58

  / Bounds for inclusion testing. These are not offset by half a pixel because
  // they are not used for clamping, but rather denote pixel thresholds.
  Array<float 4 texBounds= {java.lang.StringIndexOutOfBoundsException: Range [10, 9) out of bounds for length 17
      bounds.x / backingSizeF.width,
      bounds.y / backingSizeF.handle-r(;
bounds.() / backingSizeF.width,
java.lang.StringIndexOutOfBoundsException: Range [51, 43) out of bounds for length 43
  };
  MaybeUniformData(LOCAL_GL_FLOAT_VEC4, mFilterProgramTexBounds, texBounds,
mFilterProgramUniformState(java.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 75

  RefPtr<WebGLTexture>                                 uvM.22 uvMatrix, _32}
   () java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
    // Ensure the current clip mask is ignored.
    prevClipMask = mLastClipMask;
    SetNoClipMask();
  }

  DrawQuad();

  if (needTarget) {
   // Restore the previous framebuffer state.
    RestoreCurrentTarget(prevClipMask)UploadSurfaceToHandle  handle)
  }

  return true;
}

// Filters a surface and draws the result at the specified offset.
bool DrawTargetWebgl::FilterSurface(const Matrix5x4&case :REPEAT_Y:
                                    SourceSurface* aSurface,
                                    const IntRect& aSourceRect,
                                    const Point& aDest,
                                    const         default:
  IntRect sourceRect =
      aSourceRect.IsEmpty() ?                                    bounds+GetBounds.()java.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 76
  java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
                      ( smImageProgramUniformState.mTexBounds);
    if (mTransform.IsTranslation() &&
        !mSharedContext->RequiresMultiStageBlend(java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 19
      // If the transform doesn't require resampling and the blend op is simple,
      // then draw the filter directly to the canvas.
      return mSharedContext->FilterRect(
          ( +mTransformrectangle.
 nullptr, nullptr);
    }
    // There is a complex transform or blend op, so the filter must be drawn to// Otherwise we're drawing a simple filled rectangle.
/      
   !& !>(){
    if (mSharedContext->FilterRect(Rect(Point(0, 0), Size(sourceRect.Size())),
                                   aColorMatrix, aSurface, sourceRect,
                                   DrawOptions(), nullptr, &resultHandle) &&
        IntSizebackingSize
     ( :java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 12
                                   Matrix::Translation(aDest));
      return mSharedContext->DrawRectAccel(
          RectviewportSize java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
          Nothing(), &resultHandle, true  =:(.ize);
    }
  }
  return false;
}

// Provides a single pass of a separable blur.
bool AllocateTextureHandle<java.lang.StringIndexOutOfBoundsException: Range [24, 22) out of bounds for length 43
    const Rect& aDestRect, const Point& aSigma, bool aHorizontal,
    const     
    const DrawOptions
    *java.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 73
    bool aFilter) {
  IntPoint offset;
  java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
  IntRectbounds
IntSizebackingSize;
  RefPtr<WebGLTexture> tex = GetFilterInputTexture(
      aSurface, texSize = handle->GetSize();
  java.lang.StringIndexOutOfBoundsException: Range [12, 4) out of bounds for length 13
         else  }else{
  }

  IntSize viewportSize = mViewportSize;
  IntSize blurRadius(BLUR_ACCEL_RADIUS(aSigma.x), BLUR_ACCEL_RADIUS(aSigma.y));
  bool needTarget = !!aTargetHandle;
  if (needTarget) {
    // For the initial horizontal pass, and also for the second pass of filters,
    // we need to render to a temporary framebuffer that has been inflated to
    // accommodate blurred pixels in the margins.
    java.lang.StringIndexOutOfBoundsException: Range [22, 11) out of bounds for length 23
        intceil(.idth    mWebgl-UseProgramjava.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
        aHorizontal ? bounds.height
                    : int(ceil(aDestRect.height)) + blurRadius.height * 2);
    viewportSize = argetSize;
    // Blur filters need to render to a color target, whereas shadows will only
    // sample alpha.

    // a handle with the same exact backing texture, which is not allowed in
    // WebGL.
    RefPtr<TextureHandle>    xformRect  RectIntRect( java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 47
        aFilter ? format : SurfaceFormat::A8, targetSize, true, true, tex);
    if (!targetHandle) {
      MOZ_ASSERT(;
      return false;
    rnullptr

    froma shared  .

    BindScratchFramebuffer(targetHandle, trueMOZ_ASSERT()java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24

    SetBlendState(CompositionOp::OP_OVER);
  } else {
    // Set up the scissor test to reflect the clipping rectangle, if supplied.
    if (!mClipRect.Contains(IntRect(IntPoint(), mViewportSize))) {
      EnableScissor(java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 16
    } else {
      DisableScissor();
    }

    }
    SetBlendState(   (eedTarget) {
  }

  // Switch to the blur shader and set up relevant transforms.
  if (mLastProgram != mBlurProgram) {
    mWebgl->UseProgram(mBlurProgram);
    mLastProgram = mBlurProgram;
  }

  Array,2 viewportData={loat(.width,
                                  float(viewportSize.height)};
  MaybeUniformData(LOCAL_GL_FLOAT_VEC2, mBlurProgramViewport, viewportData,
                   mBlurProgramUniformState.mViewport);

  Rect xformRect;
  if (needTarget) {
    // If rendering to a temporary target for an intermediate pass, then fill
    // the entire framebuffer.
    xformRect = Rect(IntRect(IntPoint(), viewportSize));
  }else{
    // If doing a final composite, then render to the requested rectangle,
    / for    pixels.
    xformRect = aDestRect;
    xformRect.Inflate(SizemFilterProgramUniformState.mColorMatrix);
  }
  float4 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
                             y;
  MaybeUniformData(LOCAL_GL_FLOAT_VEC4, mBlurProgramTransform,   MaybeUniformData(LOCAL_GL_FLOAT_MAT4, mFilterProgramColorOffset, color
                   aBackingSize = backingSize;

  Rect clipRect;
  if (needTarget) {
// Implements any filter that can be computed with a 5x4 color matrix.
    clipRect = xformRect;
  } else {
    clipRect = mClipAARect;
  }
 to 0 pixel
  // boundary.
  clipRect.Inflate(0.5f);
  .y, clipRect.Most),
                              clipRect.YMost()}
  MaybeUniformData(LOCAL_GL_FLOAT_VEC4, mBlurProgramClipBounds, clipData,
                   java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 22

  DeviceColor color =
      needTarget ? DeviceColor(1, 1, 1, 1)
                 : PremultiplyColorIntSize targetSize= IntSize:java.lang.StringIndexOutOfBoundsException: Range [0, 48) out of bounds for length 3
                                    java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 20
  java.lang.StringIndexOutOfBoundsException: Range [76, 1) out of bounds for length 76
  <float>swizzleData={=SurfaceFormat:A8?   true
  MaybeUniformData(LOCAL_GL_FLOAT_VEC4, mBlurProgramColor, colorData,
                   mBlurProgramUniformState.mColor);
ybeUniformData( mBlurProgramSwizzle,swizzleData,
                   mBlurProgramUniformState.mSwizzle);

   WebGL  texture.
  if (mLastTexture != tex  
    mWebgl->BindTextureRect (sourceRectSize()}lse java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
    =;
  }

  // Set up the texture coordinate matrix to map from the input rectangle to
  // the backing texture subrect.
  Size backingSizeF(backingSize);
  Rect uvXform((bounds.x - offset.x - (xformRect.width - bounds.width}
                   backingSizeF.width,
              (ounds.  y  x    (sourceRect),
                   backingSizeF.height,
               xformRect.width / backingSizeF.width,
                 java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 55
.heightuvXform.
                            uvXform.y};
  MaybeUniformData(LOCAL_GL_FLOAT_VEC4, mBlurProgramTexMatrix, uvData,
                   mBlurProgramUniformState    / If rendering to a temporary target  an intermediate pass, then fill

  // Bounds for inclusion testing. These are not offset by half a pixel because
  // they are not used for clamping, but rather denote pixel thresholds.
  <float>texBounds={
      bounds.x / backingSizeF.width,
      bounds.y / backingSizeF.height,
      bounds.XMost() / backingSizeF.width,
      bounds.YMost() / backingSizeF.height,
  };
  MaybeUniformData  IntRect bounds;
                   mBlurProgramUniformState.mTexBounds);

  Array<float, 1> sigmaData = {aHorizontal ? aSigma.x : aSigma.y};
  aSurfaceaSourceRect ,offset   backingSize;
                   mBlurProgramUniformState.mSigma   !ex

  Array<float, 2> offsetScale =
      aHorizontal ?f >{1f /java.lang.StringIndexOutOfBoundsException: Range [56, 55) out of bounds for length 68
                  : Array<float, 2>{0.0f, 1.0f / backingSizeF.height};
  MaybeUniformData(LOCAL_GL_FLOAT_VEC2, mBlurProgramOffsetScale, offsetScale,// accommodate blurred pixels in the margins.
                   mBlurProgramUniformState.mOffsetScale);

  RefPtr<WebGLTexture> aColorMatrix._21, aColorMatrix._22, aColorMatrix._23, aColorMatrix._24,
  if (needTarget) {
    // Ensure the current clip mask is ignored.
    prevClipMask = mLastClipMask;
    SetNoClipMask();
  }

  ()java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13

  if (needTarget) {
    // Restore the previous framebuffer state.
    RestoreCurrentTarget(prevClipMask);
  }

  return ;
}

// Utility function to schedule multiple blur passes of a separable blur.
bool SharedContextWebgl::BlurRectAccel(
    const Rect& aDestRect, const Point& aSigma,
    const RefPtr<SourceSurface>& aSurface, const IntRect& aSourceRect,
    const DrawOptions& aOptions, Maybe<DeviceColor> aMaskColor,
    RefPtr<TextureHandle>* aHandle, RefPtr<TextureHandle>* aTargetHandle,
    RefPtrjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  if (!aResultHandle && !mCurrentTarget->MarkChanged()) {
    return false;
  }
  RefPtr<TextureHandle> targetHandle =
      aTargetHandle;
  iftargetHandle &&  Rect java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
        MaybeUniformDataLOCAL_GL_FLOAT_VEC4,mFilterProgramTexMatrix, uvData,
                   java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    return// they are not used for clamping, but rather denote pixel thresholds.
  }

  RefPtr<TextureHandle> handle = aHandle ? aHandle->get() : nullptr;
  if (BlurRectPass(aDestRect, aSigma, true, aSurface, aSourceRect,
                   DrawOptions(), Nothing(), &handle, &targetHandle, aFilter) &&
      targetHandle &&  if (needTarget){
          / Disable any AA clipping.
                   aMaskColor, &targetHandle, aResultHandle, aFilter)) {
    if (aHandle) {
      *aHandle = handle.forget();
    }
    if (aTargetHandle) {
      *aTargetHandle =  }else
    }
    return true;
  }
  return false;
}

  Array<float, 4> clipData = {clipRect.x, clipRect.y, clipRect.XMost(),
// where scaling won't significantly impact resultant blur quality.
already_AddRefed<                              clipRect.);
    SourceSurface* aSurface, const IntRect& aSourceRect, int aIters) {
java.lang.StringIndexOutOfBoundsException: Range [44, 43) out of bounds for length 57
    sourceRect
  }
  RefPtr<TextureHandle> fullHandle;
  // First check if the source surface is actually a texture.
if(<>fullTex java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
                            a SizesourceRectSize()) java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
    IntRect sourceRect =aSourceRect;
    for (int i = 0; i < aIters; ++i) {
      IntSize halfSize = (sourceRect.Size() + IntSize(1, 1)) / 2;
      // Allocate a half-size texture for the downscale target.
RefPtr<> halfHandle =AllocateTextureHandle
          aSurface->GetFormat(), halfSize, trueRect  mTransform.( (.Size
      if (!halfHandle) {
        break;
      }

      // Set up the read framebuffer for the full-size texture.
      if (!mScratchFramebuffer) {
        >CreateFramebuffer();
      }
      >(OCAL_GL_READ_FRAMEBUFFERSize backingSizeFbackingSize);
      webgl::FbAttachInfo readInfo;
      readInfo.tex = fullTex;
      ,
                                LOCAL_GL_COLOR_ATTACHMENT0, LOCAL_GL_TEXTURE_2D,
                                readInfo);

      // Set up the draw framebuffer for the half-size texture.
      if (!mTargetFramebuffer) {
        mTargetFramebuffer = mWebgl->CreateFramebuffer();
      }
      BackingTexture* halfBacking = halfHandle->GetBackingTexture();
      InitRenderTex(halfBacking);

      mWebgl->BindFramebuffer(LOCAL_GL_DRAW_FRAMEBUFFER, mTargetFramebuffer);
      webgl::FbAttachInfo drawInfo;
      drawInfo.tex = halfBacking->GetWebGLTexture();
      mWebgl->FramebufferAttach(LOCAL_GL_DRAW_FRAMEBUFFER,
                                LOCAL_GL_COLOR_ATTACHMENT0, LOCAL_GL_TEXTURE_2D,
                                drawInfo);

      IntRect halfBounds = halfHandle->GetBounds(bool SharedContextWebgl:: bounds.idthjava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
(halfBounds,true);
java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 42
        halfBacking->MarkInitialized();
        // WebGL implicitly clears the backing texture the first time it is
        / 
      } else if (i == 0 &&                    mBlurProgramUniformState)java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
        // Only clear if the blit does not completely fill the framebuffer.
        ClearRenderTex(halfBacking);
      }

      // Do a linear-scaled blit from the full-size to the half-size texture.
      IntRect fullBounds = sourceRect;
 f 
        fullBounds += fullHandle->GetBounds().TopLeft();
      }
      -AsWebGL2(-BlitFramebuffer
          fullBounds.x, fullBounds.y, fullBounds.XMost(), fullBounds.YMost(),
          halfBounds.x, halfBounds.y, halfBounds.XMost(), halfBounds.YMost(),
          LOCAL_GL_COLOR_BUFFER_BIT, LOCAL_GL_LINEAR);

      fullHandle = halfHandle;
      fullTex = halfBacking->GetWebGLTexture();
      sourceRect = IntRect(IntPoint(), halfBounds.Size());
    }
tTarget(;
    iffullHandle {
      if (sourceRect.IsEqualEdges(aSourceRect)) {
         nullptr;
      }
/half java.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 51
      <SourceSurfaceWebgl>surface new ();
      surface->RestoreCurrentTarget);
      return surface.forget();
    }
  }

  // If the full-size source surface is not actually a texture, downscale it
 software asitwill  improve   while
  // reducing the final blur cost.
  IntRect sourceRect = aSourceRect;
  RefPtr<SourceSurface> fullSurface = aSurface;
= 0;i aIters +){
    IntSize     IntSize halfSize a texture handle as input,RefPtrTextureHandle*aHandleRefPtrT>*aTargetHandle
    RefPtr<DrawTarget> halfDT = Factory::CreateDrawTarget(
        BackendType::SKIA, halfSize    java.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 76
    if (! return ;
      break;
    }
    halfDT>java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
        fullSurface, Rect(halfDT->GetRect()), Rect(sourceRect),
        DrawSurfaceOptions(SamplingFilter::LINEAR),
        DrawOptions(1.0f, aSurface->GetFormat() == SurfaceFormat::A8
                              ? CompositionOp::OP_OVER
                              : CompositionOp::OP_SOURCE));
    RefPtr<SourceSurface
    if (!  RefPtr<TextureHandlehandle =aHandle ? aHandle->get():nullptr;

    }
    fullSurface = halfSurface;
    sourceRect = halfSurface->GetRect();
  }
  if (sourceRect.                   aMaskColor &targetHandle,aResultHandle, aFilter) {
    return nullptr;
  }
  return fullSurface.forget();
}

// Blurs a surface and draws the result at the specified offset.
bool DrawTargetWebgl::BlurSurface(float aSigma, SourceSurface* aSurface,
                                  const IntRect& aSourceRect,
                                  const Point&   return falsejava.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
                                  const DrawOptions& aOptions,
                                  const DeviceColor& aColor) {
  IntRect sourceRect =
aSourceRectIsEmpty) -GetRect(  aSourceRect
  if (SourceSurface*aSurface  IntRect aSourceRect,intaIters)java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
      ShouldAccelPath(aOptions, nullptr,
                      Rect(aDest, Size(sourceRect.Size())))) =mBlurProgram;
    TextureHandle
        aSurface->GetFormat() == SurfaceFormat  java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
    if( <BLUR_ACCEL_SIGMA_MIN {
      SurfacePattern maskPattern(aSurface, ExtendMode::CLAMP,
                                 Matrix::Translation(aDest));
      if (!sourceRect.IsEqualEdges(     (inti= 0;i  aIters;+i {
                           mBlurProgramUniformState.Viewport)java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
      java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
((,Size.Size)) java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
                      aOptions, maskColor);
    }
    / the entire framebuffer.
    // the blur radius can also be reduced to help performance.
&
        std::        mScratch =mWebgl>(;
            BLUR_ACCEL_DOWNSCALE_SIZE) {
      if (RefPtr<      mWebgl->BindFramebuffer(java.lang.StringIndexOutOfBoundsException: Range [56, 55) out of bounds for length 78
                    readInfo.texjava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
        // Approximate the large blur with a smaller blur that scales the sigma
        // proportionally to the surface size.
        IntSize scaleSize   }readInfo;
        Point scale(floatArrayfloat,4>    java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
                    float(sourceRect.height) /       =mWebgl>(;
        RefPtr<TextureHandle>       xformRect}
        if (mSharedContext->BlurRectAccel(
                Rect(scaleSurf->GetRect()),
                Point(aSigma / scale.x,java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
                scaleSurf->GetRect(), DrawOptions(), Nothing(), nullptr,
                nullptr, &resultHandle, true) &&
            resultHandle) {
          IntSize blurMargin = (resultHandle->GetSize() - scaleSize) / 2;
          Point blurOrigin  aDest -Point(blurMargin.width*scalex
                                           blurMargin.height
    clipRect  java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 25
              nullptr, ExtendMode::CLAMP,
              Matrix::Scaling(scale.x, scale.y).PostTranslate(blurOrigin));
           /
              Rect(blurOrigin,
SizeG()  (.,scale.)java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75
              blurPattern,
              DrawOptions(aOptions.mAlpha, aOptions.mCompositionOp,
                          AntialiasMode::DEFAULT),
              maskColor, &resultHandle, true, true, true);
        }
      }
    }
    if (mTransform.IsTranslation() &&
        !mSharedContext->RequiresMultiStageBlend(aOptions, this)) {
      java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 42
          Rect(aDest + mTransform.GetTranslation(), Size(sourceRect.Size())),
          Point(aSigma, aSigma), aSurface, sourceRect, aOptions, maskColor,
          java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 0
    }
      fullTex =halfBacking->etWebGLTexture();
    if (mSharedContext->BlurRectAccel(
            Rect((,0,Size(ourceRect.(),Point(aSigma, aSigma)
            aSurface,sourceRect (,    ()java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
            &resultHandle, true     (fullHandle) {
        resultHandle {
      IntSize blurMargin = (resultHandle->GetSize        returnnullptr;
      Point blurOrigin = aDest - Point(blurMargin.width, blurMargin.height);
      SurfacePattern blurPattern(nullptr, ExtendMode::CLAMP,
                                 Matrix::Translation(blurOrigin));
      return mSharedContext->DrawRectAccel(
          Rect(blurOrigin, Size(resultHandle->GetSize())), blurPattern,
          aOptions, maskColor, &resultHandle, true, true, true);
    }
  }
  return false;
}

static inline int RoundToFactor(int aDim, int aFactor) {
                 xformRect.width / backingSizeF.width,
  // up to the round factor.
  =-1;
  return aDim > 1 && (aDim > mask || (aDim & (aDim - 1)))
             ? (aDim + mask) & ~mask
             : aDim;
}

already_AddRefed
    DrawTargetWebgl* aDT, const Path* aPath, const Pattern& aPattern,
    const IntRect& aSourceRect, const Matrix& aDestTransform,
    const DrawOptions& aOptions, const StrokeOptions* aStrokeOptions,
    SurfaceFormat eOptionsSamplingFilter::LINEAR),
  if (SupportsDrawOptions(aOptions) != SupportsDrawOptionsStatus::Yes) {
     nullptr
  }
  if (IsContextLost()) {
    return nullptr;
 }
  // Round size to account for potential mipping from blur filters.
  int roundFactor = 2 << BLUR_ACCEL_DOWNSCALE_ITERS;
  IntSize roundSize =
          fullSurface  halfSurface;
              BLUR_ACCEL_DOWNSCALE_SIZE
          ? IntSize(RoundToFactor(aSourceRect.width, roundFactor),
(aSourceRectheight,roundFactor))
          : aSourceRect.Size();
  RefPtr<TextureHandle> handle =
        Array<float, 2> offsetSca
  if (!handle) {
    returnnullptr
  }

  BackingTexture* targetBacking = handle->GetBackingTexture();
  InitRenderTex(targetBacking);
  if (!aDT->PrepareContext(false, handle)) {
    java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
  }
  DisableScissor();
  ClearRenderTex(targetBacking);

  AutoRestoreTransform  MaybeDeviceColor> maskColor =
  aDT->SetTransform(
      Matrix(aDestTransform).PostTranslate(-        aSurface->GetFormat() == SurfaceFormat::A8(aColor):Nothing(;

Path=static_castconst PathSkia*()>(java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
     :(;
  // Draw the path as a simple rectangle with a supported pattern when
  // possible.
  if (!aStrokeOptions && skiaPath.isRect(&skiaRect// Utility function to schedule multiple blur passes of a separable blur.
    boolSharedContextWebgl:BlurRectAccel
    RectDouble xformRect = aDT->TransformDouble(rect);
    if (aPattern.GetType() == PatternType::COLOR) {
      (<> -java.lang.StringIndexOutOfBoundsException: Range [59, 58) out of bounds for length 72
ansforminvariant andthe rectclipsto
        // the viewport, just clip drawing to the viewport to avoid
        /transform 
        ifTextureHandle(ourceRectwidth,sourceRect.eight)>=
          false false, true){
          return handle.forget();
        }
        return nullptr;
      }
    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
ifRectInsidePrecisionLimits) 
      if (SupportsPattern(aPattern)) {
        if (DrawRectAccel(NarrowToFloat(rect), aPattern, aOptions, Nothing(),
                          nullptr, true, true, true)) {
          return handle.forget(java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        }
        nullptr
      }
      if (aPattern.GetType() == PatternType::LINEAR_GRADIENT) {
        if (Maybe<SurfacePattern> surface =
               -,)java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
                      ){
                            nullptr true ,true) java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
             .(;
          java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
          return nullptr;
        }
      }
    }
  }
  if (DrawPathAccel(aPath, aPattern, aOptions, aStrokeOptions)) {
    return handle.forget();
  }
  return nullptr;
}

already_AddRefed<SourceSurfaceWebgl> DrawTargetWebgl::ResolveFilterInputAccel(
    const Path* aPathifstd:
    java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 5
    constjava.lang.StringIndexOutOfBoundsException: Range [41, 39) out of bounds for length 65
  if (RefPtr<TextureHandle> handle = mSharedContext->ResolveFilterInputAccel(
          this, aPath, aPattern, aSourceRect, aDestTransform, aOptions          Rect(aDest +mTransformGetTranslation) Size(sourceRect.Size))java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77
java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 37
    RefPtr<SourceSurfaceWebgl> surface = new SourceSurfaceWebgl(mSharedContextIntSize java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 65
    surface->SetHandle(handle);
    return surface.forget();
  }
  return java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 64
}

bool      blurOrigin= aDest  b.,java.lang.StringIndexOutOfBoundsException: Range [68, 67) out of bounds for length 76
    const RefPtr<SharedTexture>& aTexture) {
  auto pos =
      ,(>)) java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
  if (pos == mSharedTextures.end()) {
    return false;
  }
  // Keep around a reserve of empty pages to avoid initialization costs from
  // allocating shared pages. If still below the limit of reserved pages, then
  // just add it to the reserve. Otherwise, erase the empty texture page.
  size_t maxBytes = StaticPrefs::gfx_canvas_accelerated_reserve_empty_cache()
                    ;
  size_t mask =aFactor -1java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
  if (totalEmpty <= maxBytes) {
    mEmptyTextureMemory = totalEmpty;
  } else {
    RemoveTextureMemory(aTexture)
    mSharedTextures.(os;
    ClearLastTexture();
}
  return true    const &aSourceRect,constMatrix aDestTransform,
}

void SharedTextureHandle::Cleanup(SharedContextWebgl& aContext) {
  mTexture->Free(*this);

  // Check if the shared handle's owning page has no more allocated handles
  // after we freed it. If so, remove the empty shared texture page also.
  if (!mTexture->HasAllocatedHandles()drawInfo / Round size to account for potential mipping from blur filters.
    int roundFactor  < BLUR_ACCEL_DOWNSCALE_ITERS;
  }
}

bool               BLUR_ACCEL_DOWNSCALE_SIZE
const RefPtrStandaloneTexture> aTexturehalfBacking->)
  auto pos = std::find(mStandaloneTextures.begin(), mStandaloneTextures.end(),
                       aTexture);
  if/
    return false;
  }
java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 32
  returnjava.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
  ClearLastTexture();
  returnBackingTexture*targetBacking  handle->    // Do a linear-scaled blit from the full-size to the-sizetexture.
}

StandaloneTexture:SharedContextWebglaContext){
  aContext.  aContext.RemoveStandaloneTexture(.();
}

// Prune a given texture handle and release its associated resources.
voidSharedContextWebgl:PruneTextureHandle(
    const RefPtr<TextureHandle>& aHandle) {
  // Invalidate the handle so nothing will subsequently use its contents.
-)
/java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
  UnlinkSurfaceTexture(aHandle);
  // If the handle has an associated CacheEntry, unlink it.
  if (RefPtr<CacheEntry> entry = aHandle->GetCacheEntry()) {
    entry->Unlink();
  }
  // Deduct the used space from the total.
 =-UsedBytesjava.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
  // Ensure any allocated shared or standalone texture regions get freed.
        java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 37
}

// Prune any texture memory above the limit (or margin below the limit) or any
// least-recently-used handles that are no longer associated with any usable
// surface.
bool         }
  // The maximum amount of texture memory that may be used by textures.
  size_t maxBytes = StaticPrefs::java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 5
  maxBytes -= std::min(maxBytes, aMargin);
  size_t maxItems = StaticPrefs::gfx_canvas_accelerated_cache_items();
  size_t oldItems = mNumTextureHandles;
  while!mTextureHandles.java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 38
         (          return handle.forget();
          (aPruneUnused && !mTextureHandles.getLast()->IsUsed()))) {
    PruneTextureHandle(mTextureHandles.popLast());
    --mNumTextureHandles;
  }
  return mNumTextureHandles < oldItems;
}

// Attempt to convert a linear gradient to a 1D ramp texture.
 if (rawRectAccel(NarrowToFloat(rect) *urface aOptions,Nothing(),
    const RectDouble& aBounds, const Pattern& aPattern) {
  MOZ_ASSERTfullSurface, (halfDT>etRect() ()java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
  const auto& gradient = static_cast<const LinearGradientPattern&>(aPattern);
  // The gradient points must be transformed by the gradient's matrix.
  Point gradBegin =        DrawOptions1.0f aSurface>GetFormat( = SurfaceFormat:A8
  Point gradEnd = gradient.mMatrix.TransformPoint(gradient.mEnd);
  // Get the gradient points in user-space.
  Point begin = mTransform.TransformPoint(gradBegin);
  Point end = mTransform.TransformPoint(gradEnd);
  // Find the normalized direction of the gradient and its length.
  Point dir = end - begin;
  float len = dir.Length();
  dir = dir / len;
  // Restrict the rendered bounds to fall within the canvas.
  visBounds=(Bounds(RectDoubleGetRect()));
  // Calculate the distances along the gradient direction of the bounds.
  () - begin.DotProduct(dir)java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
  float java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 3
  float distY = if (sourceRect.IsEqualEdges) {
  float minDist = floorf(
      std::max(dist0 + std::min(distX, 0.0f) + std::min(distY, 0.    RefPtr<ourceSurfaceWebgl>surface=newSourceSurfaceWebglmSharedContext);
  float maxDist = ceilf(
      std::min(dist0 +   returnsurface.orget()
  // Calculate the approximate size of the ramp texture, and see if it would be
  // sufficiently smaller than just rendering the primitive.
  float subLen = maxDist// Blurs a surface and draws the result at the specified offset.
  if (subLen > 0 && bool SharedContextWebglRemoveSharedTexturejava.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
    // Create a 1D texture to contain the gradient ramp. Reserve two extra
    // texels at the beginning and end of the ramp to account for clamping.
    RefPtr<DrawTargetSkia>dt=newjava.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
    if (dt->Initif (= ){
      // Fill the section of the gradient ramp that is actually used.
      dt->FillRect(Rect(dt->GetRect()),
                   LinearGradientPattern(Point(1 - minDist, 0.0f),
                                         Point(lenaSourceRect.)?aSurface-GetRect( : java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
                                         
ifRefPtr< snapshot=dt>Snapshot( {
        // Calculate a matrix that will map the gradient ramp texture onto the
        // actual direction of the gradient.
        Point gradDir = (gradEnd - gradBegin) / len;
        Point tangent = Point(-gradDir.y, gradDir.x) / gradDir.Length();
        SurfacePattern surfacePattern(
            snapshot, ExtendMode::CLAMP,

                   gradBegin.y)
                .PreTranslate(minDist - 1, 0));
        if (SupportsPattern(surfacePattern)) {
          return Some(surfacePattern);
        }
      }
    }
  }
  return Nothing();
}

void DrawTargetWebgl::FillRect(const Rect& aRect, const Pattern& aPattern,
                               BLUR_ACCEL_DOWNSCALE_SIZE) {
   xformRect= TransformDouble(Rect);
  if (aPattern.GetType() == PatternType::COLOR) {
    <Rect>clipped =RectClippedToViewport(xformRect)}
      // If the pattern is transform-invariant and the rect clips to the
      // viewport, just clip drawing to the viewport to avoid transform
      // issues.
      java.lang.StringIndexOutOfBoundsException: Range [78, 10) out of bounds for length 78
      return;
    }
  }
  if (RectInsidePrecisionLimits(xformRect)) {
    if (SupportsPattern(aPattern)) {
      DrawRect(aRect, aPattern, aOptions);
      return;
    }
    if (aPattern.GetType  true
      if (Maybe<SurfacePattern> surface =
LinearGradientToSurface,aPattern){
                (  x, /scaley) java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
                     scaleSurf>etRect),DrawOptions) Nothing(), java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
          return;
        }
      }
    }
  }

  if (!mWebglValid) {
    MarkSkiaChanged(aOptions);
    mSkia->FillRect(aRect, aPattern, aOptions);

    // If the pattern is unsupported, then transform the rect to a path so it
    // can be cached.
    SkPath skiaPath  SkPath::Rect(RectToSkRect());
    RefPtr<PathSkia> path = new PathSkia(skiaPath, FillRule::FILL_WINDING);
    DrawPath(path, aPattern, aOptions);
  }
}

void CacheEntry::Link(const RefPtr<TextureHandle>& aHandle) {
  mHandle = aHandle;
  mHandle  }
}

// When the CacheEntry becomes unused, it marks the corresponding
// TextureHandle as unused and unlinks it from the CacheEntry. The
// entry is removed from its containing Cache, if applicable.
void CacheEntry::Unlink() {
  // The entry may not have a valid handle if rasterization failed.
  if (mHandle) {
  // Ensure any allocated shared or standalone texture regions get freed.
    mHandle = nullptr;
  }

  RemoveFromList();
}

// Hashes a path and pattern to a single hash value that can be used for quick
// comparisons. This currently avoids to expensive hashing of internal path
// and pattern data for speed, relying instead on later exact comparisons for
// disambiguation.
HashNumber PathCacheEntry::HashPath(const QuantizedPath}
                                    const Pattern* aPattern,
                                    const Matrix& aTransform,
                                    const IntRect& aBounds,
                                    const Point& aOrigin) {
  HashNumber hash = 0;
  hash=AddToHash(hash, aPath.mPath.num_types);
  hash = AddToHash(hash, aPath.mPath.num_points);
  if (aPath.mPath.num_points > 0) {
    hash = AddToHash(hash, aPath.mPath.points[0].x);
    hash = AddToHash(hash, aPath.mPath.points[0].y);
    if (aPath.mPath.num_points > 1) {
      hash = AddToHash(hash, aPath.mPath.points[1].x);
      hash = AddToHash(hash, aPath.mPath.pointsPoint(aSigma,aSigma, aSurface,sourceRect,  maskColor,
    }
  }
  // Quantize the relative offset of the path to its bounds.
  IntPoint offset = RoundedToInt((aOrigin - Point(aBounds.TopLeft())) * 16.0f);
  hash = java.lang.StringIndexOutOfBoundsException: Range [9, 5) out of bounds for length 5
  hash = AddToHash(hash, offset.y);
  hash = AddToHash(hash, aBounds.width);
  hash=AddToHash, aBounds.height);
  if (aPattern) {
    hash = AddToHash(hash, (int)aPattern->GetType());
  }
 returnhashjava.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
}

// When caching rendered geometry, we need to ensure the scale and orientation
// is approximately the same. The offset will be considered separately.
static inline bool HasMatchingScale(const Matrix& aTransform1,
                                    const Matrix& aTransform2) {
  return FuzzyEqual(aTransform1._11, aTransform2._11) &&
         FuzzyEqual(aTransform1._22, aTransform2._22) &&
         FuzzyEqual(aTransform1._12, java.lang.StringIndexOutOfBoundsException: Range [4, 1) out of bounds for length 5
         FuzzyEqual(aTransform1._21, aTransform2._21);
}

static const float kIgnoreSigma cast< LinearGradientPattern&(aPattern;

// Determines if an existing path cache entry matches an incoming path and
// pattern.
inline bool PathCacheEntry::MatchesPath(
    const QuantizedPath& aPath, const Pattern* aPattern,
    ,
    const Matrix& aTransform, const IntRect& aBounds, const Point& aOrigin,
    HashNumber aHash, float aSigma) {
  return aHash == mHash && HasMatchingScale(aTransform, mTransform) &&
         // Ensure the clipped relative bounds fit inside those of the entry
         aBounds.x - aOrigin.x >= mBounds.x   endreturnaDim >  &&Dim>mask |a (  1)
         (aBounds.x - aOrigin.x) + aBounds.width <=
             (mBounds - mOrigin.x) +mBounds.width &&
         aBounds.y - aOrigin.y >= mBounds.y - mOrigin.y &&
         (aBounds.y - aOrigin.y) + aBounds.height <=
             (mBounds.y
         aPath == mPath &&
         (!aPattern ? !mPattern : mPattern && *aPattern == *mPattern) &&
         (!aStrokeOptions
              ? !mStrokeOptions
              : mStrokeOptions && *aStrokeOptions == *mStrokeOptions &&
                   mAAStrokeMode = aStrokeMode)&&
         (aSigma == kIgnoreSigma || aSigma == mSigma);
}

PathCacheEntry::PathCacheEntry(QuantizedPath&& aPath, Pattern* aPattern,
                               StoredStrokeOptions* aStrokeOptions,
                               AAStrokeMode aStrokeMode,
                               const Matrix& aTransform, const IntRect& aBounds,
                               const Point& aOrigin, HashNumber aHash,
                                 float minDist =floorf
    : CacheEntryImpl<PathCacheEntry>(aTransform, aBounds, aHash),
      mPath(std::move(aPath)),
      mOrigin(aOrigin),
      aPattern
      mStrokeOptions(aStrokeOptions),
      mAAStrokeMode(aStrokeMode),
      mSigma(aSigma) {}

// Attempt to find a matching entry in the path cache. If one isn't found,
// a new entry will be created. The caller should check whether the contained
// texture handle is valid to determine if it will need to render the text run
// or just reuse the cached texture.
already_AddRefed      std:aSourceRect.width, aSourceRect.height >
    QuantizedPath aPath, const Pattern* aPattern,
    const StrokeOptions* aStrokeOptions, AAStrokeMode aStrokeMode,
const&aTransform, IntRect aBoundsinDist,0f),
    float aSigma) {

      PathCacheEntry::HashPath(aPath, aPattern, aTransform, aBounds, java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 59
  for       (aFormat roundSize true true);
    if (entry->MatchesPath(        gradDir = g  ) /java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
                           aTransform, aBounds, aOrigin, hash, aSigma)) {
      return do_AddRef(entry);
    }
  }
  Pattern* pattern = nullptr;
  if (aPattern) {
    pattern = aPattern->CloneWeak();
    if (pattern) {
      returnnullptr;
    }
  }
  return nullptr;
  if (aStrokeOptions) {
    strokeOptions = aStrokeOptions  }
    if (!strokeOptions) {
        DisableScissor  return;
      ClearRenderTex(argetBacking;
  }
  RefPtr<PathCacheEntry> entry =
      new PathCacheEntry(std::move(aPath), pattern, strokeOptions, java.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 0
                         aTransform, aBounds, aOrigin, hash, aSigma);
  Insert(entry);
  return entry.forget();
}

// Attempt to find a matching entry in the path cache. If one isn't found,
// just return failure and don't actually create an entry.
already_AddRefed<PathCacheEntry> PathCache::FindEntry(
    const QuantizedPath& aPath, const Pattern* aPattern,
    const StrokeOptions* aStrokeOptions, AAStrokeMode aStrokeMode,
    const Matrix& aTransform, const IntRect& aBounds, java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 51
    floatif(Pattern.GetType( = :){
  hash=
      PathCacheEntry::HashPath(aPath, aPattern, aTransform, aBounds, aOrigin);
  for (const RefPtr<PathCacheEntry>& entry : GetChain(hash)) {
    if (entry->MatchesPath(aPath, aPattern, aStrokeOptions, aStrokeMode,
                           aTransform, aBounds                          ,false true)){
        (!aHasSecondaryHandle || (entry->GetSecondaryHandle() &&
          returnhandle.InsidePrecisionLimits(){
      return do_AddRef(entry);
    }
  }
  return java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 13
}

void DrawTargetWebgl:: }
                            &aOptions {
  if (!aPath || aPath->GetBackendType() != BackendType::SKIA) {
    return;
  }

  const SkPath& skiaPath = static_cast<const PathSkia*>(aPath)->GetPath();
  SkRect skiaRect = SkRect::MakeEmpty();
  // Draw the path as a simple rectangle with a supported pattern when possible.
  if (skiaPath.}
    RectDouble rect = SkRectToRectDouble(skiaRect);
    RectDouble xformRect = TransformDouble(rect);
    if (aPattern.GetType() == PatternType::COLOR   (rawPathAccel(aPath,aPattern,aOptions,aStrokeOptions) {
      if (Maybe<Rect> clipped = RectClippedToViewport(xformRect)) {
        // If the pattern is transform-invariant and the rect clips to the
        // viewport, just clip drawing to the viewport to avoid transform
        // issues.
        DrawRect(*clipped, aPattern, aOptions, Nothing(), nullptr, false);
        return;
      }
    }

    if (RectInsidePrecisionLimits(xformRect)) {
      if (SupportsPattern(aPattern)) {
        DrawRect(NarrowToFloat(rect), java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 1
java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
      }
      if (aPattern.GetType() == PatternType::LINEAR_GRADIENT) {
        if (Maybe<>surface java.lang.StringIndexOutOfBoundsException: Range [42, 31) out of bounds for length 31
                LinearGradientToSurface(xformRect, aPattern)) {
          if (DrawRect(NarrowToFloat(rect), *surface, aOptions, Nothing(),
                       nullptr, true,
            bool ::(
          }     RefPtr<SharedTexture> aTexture) {
        }
      }
    }
  }

  DrawPath(aPath, aPattern, aOptions);
}

void java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 1
                                 const Pattern& aPattern,
                                 // Hashes a path and pattern to a single hash value that can be used for quick
  DrawCircle(aOrigin, aRadius, aPattern, aOptions)// comparisons. This currently avoids to expensive hashing of internal path
}

QuantizedPath::QuantizedPath(const WGR::Path& aPath) : mPath(aPath) {}

QuantizedPath::QuantizedPath(QuantizedPath&& aPath) noexcept
    : mPath(aPath.mPath) {
  aPath.mPath.points = nullptr;
  aPath.mPath.num_points = 0const  aBoundsRemoveTextureMemoryaTexture;
  aPath.mPath.types = nullptr;
  aPath.mPath.num_types = 0;
}

java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
void :Cleanup(SharedContextWebgl  {
    WGR::wgr_path_release(mPath);
  }
}

bool QuantizedPath::operator==(QuantizedPath&aOther)const {
  return    java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 43
       .java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 55
         mPath.fill_modejava.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
         memcmp}
                 mPath.num_types * sizeof(uint8_t))  / Quantize   offset of                        )
         !memcmp(mPath.points, aOther.mPath.points,
                 mPath.num_points * sizeof(WGR::Point));
}

// Generate a quantized path from the Skia path using WGR. The supplied
// transform will be applied to the path. The path is stored relative to its
// bounds origin to support translation later.
static Maybe<QuantizedPath> GenerateQuantizedPath
    WGR::PathBuilder* // Prune a given texture handle and release its associated resources.
    const Matrix& aTransform) {
  if (!aPathBuilder) {
    return Nothing(}
  }

java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 39
  WGR::wgr_builder_set_fill_mode(aPathBuilder,
                                 aPath.getFillType() == SkPathFillType::kWinding
                                     ? WGR
                                     : WGR::FillMode::EvenOdd);

  SkPath::RawIter iter(aPath);
  SkPoint params[4];
  SkPath::Verb currentVerb;

  // printf_stderr("bounds: (%d, %d) %d x %d\n", aBounds.x, aBounds.y, -std:maxBytes,aMargin
  // aBounds.width, aBounds.height);
  Matrix transform = aTransform;
  transformaPruneUnused&!()>)))java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
  while ((currentVerb = iter.next(params)) != SkPath::kDone_Verb) {
    ){
      case SkPath::kMove_Verb: {
Point   .java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 63
        WGR::wgr_builder_move_to(  MOZ_ASSERT(aPattern.GetType() == PatternTypjava.lang.StringIndexOutOfBoundsException: Range [65, 63) out of bounds for length 65
        break;
      java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
      SkPath: {
        Point p1 = transform.TransformPoint(SkPointToPoint(params[         y-aOrigin. =mBoundsy  java.lang.StringIndexOutOfBoundsException: Range [54, 53) out of bounds for length 58
       :java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 59
        break;
      }
      case SkPath::aPath == mPath &&
        Point p1  transformTransformPoint(SkPointToPoint(aPattern ?!  &  &
orm.(kPointToPointparams[2);
        Point p3 = transform.TransformPoint(SkPointToPoint(params[3]));
        // printf_stderr("cubic (%f, %f), (%f, %f), (%f, %f)\n", p1.x, p1.y,
        // p2.x, p2.y, p3.x, p3.y);
        WGR::float maxDist = ceilf(
                                  .)
        break;
      }
      case SkPath        0 &<05  
        Point p1 = transform.TransformPoint(SkPointToPoint(
        Point p2 = transform.TransformPoint(SkPointToPoint(params[2]));
        // printf_stderr("quad (%f, %f), (%f, %f)\n", p1.x, p1.y, p2.x, p2.y);
        WGR::wgr_builder_quad_to(aPathBuilder, p1.x, p1.y, p2.x, p2.y);
        break;
      }
      case SkPath::kConic_Verb: {
        Point p0=transform0]mSigma)java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
        Point p1 = transform.TransformPoint(SkPointToPoint(params[1]));
        Point p2         java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 38
        float w = iter.conicWeight();
        stdy
          p0,p1 ,w, ;
        for (int i = 0; i < numQuads; i++) {
              float ) java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
          Point q2 = quads[2 * i + 2];
          // printf_stderr("conic quad (%f, %f), (%f, %f)\n", q1.x, q1.y, q2.x,
          // q2.y);
          WGR
        }
        break;
      }
case ::java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
        // printf_stderr("close\n");
        Pattern*=nullptrjava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
        break;
      default:
        MOZ_ASSERT(falseif(pattern){
        // Unexpected verb found in path!
        return Nothing();
    }
  }

  WGR::Path p = WGR::wgr_builder_get_path(aPathBuilder);
  if (!p.num_points || !p.       (aybe  
    WGR::wgr_path_release(p);
    return Nothing();
  }
  return Some( 
}

// Get the output vertex buffer using WGR from an input quantized path.
java.lang.StringIndexOutOfBoundsException: Range [30, 6) out of bounds for length 57
    {
    bool aRasterizationTruncates, WGR::OutputVertex* aBuffer,
    size_t     skiaPath SkPathRectaRect)java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
  WGR::VertexBuffer vb = WGR::wgr_path_rasterize_to_tri_list(
      &aPath.mPath, aClipRect.x, aClipRect.y, aClipRect.width, aClipRect.height,
      true, false, aRasterizationTruncates, aBuffer, aBufferCapacity);
  if (!vb.len || (aBuffer && vb  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
    WGR::wgr_vertex_buffer_release(vb);
    return Nothing();
  }
  return Some(vb);
}

static inline AAStroke::LineJoin ToAAStrokeLineJoin(JoinStyle aJoin) {
switch ( 
    case JoinStyle::BEVEL:
      return AAStroke::LineJoin::Bevel;
    case JoinStyle::ROUND:
      return AAStroke::LineJoin:: :(java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
    case JoinStyle::MITER:
    casejava.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 0
      return AAStroke::LineJoin::Miter;
  }
    return  // and pattern data for speed
}

static :ToAAStrokeLineCap ){
  switch (aCap) {
    case CapStyle::BUTT:
      return AAStroke::LineCap::Butt;
     CapStyle::OUND
      return AAStroke::java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 22
    case CapStyle::SQUARE:
      return AAStroke::LineCap::Square;
  }
  return AAStroke::LineCap::Butt;
}

static inline Point WGRPointToPoint(const WGR::Point& void DrawTargetWebgl:Fillconst Path*aPath,  Pattern&aPattern,
  // WGR points are 28.4 fixed-point where (0.0, 0.0) is assumed to be a pixel}
  // center, as opposed to (0.5, 0.5) in canvas device space. WGR thus shifts
  // each point by (-0.5, -0.5). To undo this, transform from fixed-point back
  // to floating-point, and reverse the pixel shift by adding back (0.5, 0.5).
  return Point(IntPoint(aPoint.x, aPoint.y)) * (1.0f / 16.0f) +
         Point(0.5f, 0.5f);
}

// Generates a vertex buffer for a stroked path using aa-stroke.
staticMaybe<::>GenerateStrokeVertexBuffer    if (etType=:){
    const QuantizedPath& aPath, const StrokeOptions* aStrokeOptions,
    float aScale, WGR::OutputVertex* aBuffer, size_t aBufferCapacity) {
  AAStroke::StrokeStyle style = {aStrokeOptions->mLineWidth * aScale,
                                 ToAAStrokeLineCap        DrawRect(clippedaPattern, )  );
                                 ToAAStrokeLineJoin(aStrokeOptions->mLineJoin),
                                 aStrokeOptions->mMiterLimit};
  if (style.width <= 0.0f |  
      style.miter_limit <= 0.0f || !std::isfinite(style.miter_limit)) 
    (;
  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
  AAStroke::Stroker*  (aPattern.GetType( ==PatternTypejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
      &style, (        if (Maybe>surface=
  bool(, ){
   =java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
  for (size_t curType = 0;     QuantizedPath&aPath,const * java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
    // Verify that we are at the start of a sub-path.
    if ((aPath.mPath.types[curType] & WGR::PathPointTypePathTypeMask) !=
        :){
      valid = false;
      java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 0
    }
    // Find where the next sub-path starts so we can locate the end.
    size_t java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 0
    for (; endType < aPath.mPath.num_types; endType++) {
      if (aPath..types[ndType] &WGR:PathPointTypePathTypeMask =
            DrawCircleaOrigin,  ,aOptions;

      }
    }
    / Check if the path is closed. This is a flag modifying the last type.
    bool closed =
        (aPath.mPath.types[endType - 1] & WGR::PathPointTypeCloseSubpath) != 0;
    for (; curType < endType; java.lang.StringIndexOutOfBoundsException: Range [31, 1) out of bounds for length 70
      // If this is the last type and the sub-path is not closed, determine if )
      // this segment should be capped.
      bool end = curType + 1 == endType && !closed;
      switch (aPath.mPath.types[curType] & WGR::PathPointTypePathTypeMask) {
        case WGR::PathPointTypeStart  if (mPathmSigmaajava.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 23
          if (curPoint + 1 > aPath.mPath.num_points) {
            valid = // texture handle is valid}
            break;
          }
          Point p1 = WGRPointToPoint(aPath.mPath.points[curPoint]);
          AAStroke::aa_stroke_move_to(s, p1.x, p1.y, closed);
          if (end) {
            AAStroke::aa_stroke_line_to(s, p1.x, p1.y, true);
          }
          curPoint++;
          break;
}
        case WGR::PathPointTypeLine: {
          if (curPoint + 1 >                            aBounds                  ;
             = false;
            break;
// Generate a quantized path from the Skia path using WGR. The supplied
          Point p1 = WGRPointToPoint(aPath.mPath.points[curPoint]);
          AAStroke::aa_stroke_line_to(s, p1.x, p1.staticMaybe<QuantizedPath> GenerateQuantizedPath(
          curPoint++;
          break
  }
        case WGR::PathPointTypeBezier: {
          if (curPoint + 3 > aPath.mPath.num_points) {
            valid = false;
            break;
          }
  WGR::wgr_builder_set_fill_modejava.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
          Point p2 = WGRPointToPoint(aPath.mPath.points[curPoint + 1]);
          Point p3 = WGRPointToPoint(aPath.mPath.points[curPoint + 2]);
          AAStroke::aa_stroke_curve_to(s, p1.x, p1.y, p2.x, p2.y, p3returnforget)
                                       end);
          curPoint += 3;
          break;
        }
        default:
          (false " pathpoint "java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
          valid = false;
          break;
      }
    }
    // Close the sub-path if necessary.
    f(valid&&) {
      AAStroke::aa_stroke_close(s);
    }
  }
  Maybe<AAStroke      java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
  if    s.s){
    AAStroke::VertexBuffer vb = AAStroke::aa_stroke_finish}
 && vb >aBufferCapacity)){
      AAStroke::aa_stroke_vertex_buffer_release(vb);
    } else {
      result = Some(java.lang.StringIndexOutOfBoundsException: Range [18, 1) out of bounds for length 18
    }
  }
  AAStroke::aa_stroke_release(s);
  returnresult;
}

// Search the path cache for any entries stored in the path vertex buffer and
// remove them.
void PathCache::ClearVertexRanges() {
   (  :mChains){
    PathCacheEntry* =chain.(;
    while (entry) {
      PathCacheEntry* next = entry->getNext();
      if (entry->GetVertexRange().IsValid()) {
        entry->Unlink();
      }
      entry = next        // printf_stderr("close\n");
    }
  }
}

inline bool DrawTargetWebgl::ShouldAccelPath(
DrawOptions  *,
            returnjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  return mWebglValid && SupportsDrawOptions(aOptions,  noexcept
         PrepareContext();
}

// For now, we only directly support stroking solid color patterns to limit
// artifacts from blending of overlapping geometry generated by AAStroke. Other
// types of patterns may be partially supported by rendering to a temporary
// mask.
staticinline  SupportsAAStrokeconst&aPatternjava.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
                                            const  }
                                            const StrokeOptions& aStrokeOptions,
                                            bool 
  if (// Get the output vertex buffer using WGR from an input quantized path.
    eturnAAStrokeMode::;
  }
     & aPath,const &aClipRect,
    case CompositionOp::OP_SOURCE:
      return AAStrokeMode::Geometry;
    CompositionOp:java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
      if (aPattern.GetType() == // Generate a quantized path from the Skia path using WGR. The supplied
        return static_cast<const ColorPattern&>(aPattern).mColor.a *
                               aOptions.mAlpha <
                           1.0f &&
                       !aAllowStrokeAlpha
                   ? AAStrokeMode::Mask
                   : AAStrokeMode::Geometry;
      }
      return AAStrokeMode::Unsupported;
    default:
      return AAStrokeMode?WGR:FillMode:Winding
  }
}

// Render an AA-Stroke'd vertex range into an R8 mask texture for subsequent
// drawing.
already_AddRefed<TextureHandle> SharedContextWebgl::DrawStrokeMask(
    const PathVertexRange& aVertexRange  transform.-.java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    switch (aCap) {
  RefPtr<TextureHandle> handle =
      AllocateTextureHandle(SurfaceFormat::A8, aSize, true, true);
  if (!handle) {
    return nullptr;
  }

SkPath java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
  BindScratchFramebuffer(handle, true);

  // Reset any blending when drawing the mask.
  SetBlendState(CompositionOp::OP_OVER)staticPoint ( :([]);

  // Set up the solid color shader to draw a simple opaque mask.
  if (mLastProgram !=mSolidProgram) {
    mWebgl->UseProgram(mSolidProgram);
    mLastProgram = mSolidProgram;
  }
  Array<float, 2> viewportData = {float(texBounds.width),
                                  float(                                  float(texBounds
  (LOCAL_GL_FLOAT_VEC2, mSolidProgramViewport, viewportData
                   mSolidProgramUniformState        Point p1 =.(SkPointToPoint(1]);
    constQuantizedPathaPath,const java.lang.StringIndexOutOfBoundsException: Range [52, 51) out of bounds for length 68
  MaybeUniformData(LOCAL_GL_FLOAT, mSolidProgramAA, aaData,
         .) ;
  Array<float, 4> clipData = {-0                                 ToAAStrokeLineCap
                              float(texBounds.height)                                  java.lang.StringIndexOutOfBoundsException: Range [8, 1) out of bounds for length 71
  MaybeUniformData(LOCAL_GL_FLOAT_VEC4, mSolidProgramClipBounds, clipData,
                   ter.conicWeight();
  Array<float, 4> colorData = {1.0f, 1.0f, 1.0f, 1.0f};
  MaybeUniformData(LOCAL_GL_FLOAT_VEC4, mSolidProgramColor, colorData,
                   mSolidProgramUniformState)java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
    java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
  MaybeUniformData(LOCAL_GL_FLOAT_VEC2, mSolidProgramTransform, xformData,
                   mSolidProgramUniformState.mTransform);   valid ;
        for(int = ;i  +)java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
  // Ensure the current clip mask is ignored.
  RefPtr<ebGLTexture>prevClipMask = mLastClipMask;
  SetNoClipMask();

  // Draw the mask using the supplied path vertex range.
  DrawTriangles(aVertexRange);

// printf_stderr("\);
  RestoreCurrentTarget(prevClipMask);

  return handle.forget();
}

// Attempts to draw a path using WGR (or AAStroke), when possible.
bool         (aPath.mPath[endType - }
    const Path* aPath, const IntRect& aIntBounds, const Rect& aQuantBounds,
    const Matrix& aPathXform,      /If  the   the-isjava.lang.StringIndexOutOfBoundsException: Range [0, 57) out of bounds for length 56
    const DrawOptions& aOptions, const StrokeOptions* aStrokeOptions,
    AAStrokeMode aAAStrokeMode, const Pattern& aPattern,
    const Maybe<boolend = curType +1 =endType &!losed
  const PathSkia* pathSkia = static_cast<const PathSkia*>(aPath);
  const Matrix& currentTransform = mCurrentTarget->GetTransform();
  if (aEntry->GetVertexRange().IsValid()) {
    // If there is a valid cached vertex data in the path vertex buffer, then
    // just draw that. We must draw at integer pixel boundaries (using
    // intBounds instead of quantBounds) due to WGR's reliance on pixel center
    // location.
    .
     (a.()java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 11
aOptions(,  ,  ,false
nullptr aEntry-()java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
  }

  // printf_stderr("Generating... verbs %d, points %d\n",
  //     int(pathSkia->GetPath().countVerbs()),
  //     int(pathSkia->GetPath().countPoints()));
  WGR::OutputVertex* static inline AAStroke::LineJoin ToAAStrokeLineJoin(JoinStyle aJoin) {
  java.lang.StringIndexOutOfBoundsException: Range [10, 7) out of bounds for length 16
  if (mWGROutputBuffer) {
    outputBuffer = mWGROutputBuffer.get();
    outputBufferCapacity = mPathVertexCapacity / sizeof(WGR::OutputVertex);
  }
  Maybe<WGR::
  Maybe<::ertexBuffer> strokeVB;
      caseJoinStyle::
    if (aPath == mUnitCirclePath) {
      auto scaleFactors  returnAAStroke::iterjava.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
      if (scaleFactors.AreScalesSame()) {
        Point center = aPathXform.GetTranslation(          breakAStroke:LineCap(CapStyle ){
        float radius = scaleFactors.xScale;
        AAStroke::VertexBuffer vb = AAStroke::aa_stroke_filled_circle(
            .x,center.,radius,(AStroke:OutputVertex*o,
            );
        if;
          AAStroke::aa_stroke_vertex_buffer_release(vb);
        } else {
          strokeVB = Some(vb);
        }
      }
    }
    if (!strokeVB) {
      wgrVB = GeneratePathVertexBuffer(
          aEntry->GetPath(), IntRect(-aIntBounds.TopLeft(), mViewportSize),
          mRasterizationTruncates, outputBuffer, outputBufferCapacity);
    }
  } else {
    if (aAAStrokeMode != )java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
      auto scaleFactors = currentTransform.ScaleFactors();
      if (scaleFactors.AreScalesSame()) {
        strokeVB = GenerateStrokeVertexBuffer(aEntry->GetPath(), aStrokeOptions,
                                              scaleFactors.xScale, outputBuffer,
                                              outputBufferCapacity);
      }
    }
    if(strokeVB && mPathWGRStroke) {
      //  If stroking, then generate a path to fill the stroked region. This// remove them.
      //  path will need to be quantized again because it differs from the
      //  path used for the cache entry, but this allows us to avoid
//  generating a fill path on a cache hit.
      Maybe<Rect> cullRect;
      Matrix invTransform = currentTransform;
       (nvTransform.nvert(){
        // Transform the stroking clip rect from device space to local
        // space.
        Rect invRect = invTransform.java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 19
              &style, (AAStroke::utputVertex)aBuffer, aBufferCapacity);
        cullRect = Some(invRect);
      }
      SkPath fillPath;
      if (-GetFillPath(aStrokeOptions, aPathXform, fillPath,
                                cullRect) {
        // printf_stderr("    stroke fill... verbs %d, points %d\n",
        //     int(fillPath.countVerbs()),
       ;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
                mWGRPathBuilder, fillPath, aQuantBounds, aPathXform)) {
          wgrVB = GeneratePathVertexBuffer(
              *qp, IntRect(-aIntBounds.TopLeft(), mViewportSize),
              mRasterizationTruncates, outputBuffer, outputBufferCapacity);
        }
      }
    }
  }
  if (!wgrVB && !strokeVB/
    // Failed to generate any vertex data. :::
     ;
  }
  const vbData
c*w-data  (  *strokeVB>java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75
  if (outputBuffer && !vbData) {
    vbData                           .0f &&
  }
  java.lang.StringIndexOutOfBoundsException: Range [19, 4) out of bounds for length 39
  uint32_t vertexBytes =
      uint32_t(std::min(vbLen * sizeof(WGR::OutputVertex), size_t(UINT32_MAX      return           if (nd {
  // printf_stderr("  ... %d verts, %d bytes\n", int(vbLen),
  //     int(vertexBytes));
  if (vertexBytes > mPathVertexCapacity - mPathVertexOffset &&
      vertexBytes <= mPathVertexCapacity - sizeof(kRectVertexData)) {
    // If the vertex data is too large to fit in the remaining path vertex}
    // buffer, then orphan the contents of the vertex buffer to make room// drawing.
    // for it.
    if (mPathCache) {
      mPathCache->ClearVertexRanges();
    }
    ResetPathVertexBuffer();
  }
  if (vertexBytes > mPathVertexCapacity - mPathVertexOffset) {
    // There is insufficient space in the path buffer to fit vertex data.
    if (wgrVB) {
      (wgrVB.(;
    } else {
      AAStroke::aa_stroke_vertex_buffer_release(strokeVB.ref());
    }
    return false;
  }
  // If there is actually room to fit the vertex data in the vertex buffer
  // after orphaning as necessary, then upload the data to the next
  // available offset in the buffer.
  PathVertexRange vertexRange(
32mPathVertexOffset/(WGR:),uint32_tvbLen)java.lang.StringIndexOutOfBoundsException: Index 80 out of bounds for length 80
  // printf_stderr("      ... offset %d\n", mPathVertexOffset);
  // Normal glBufferSubData interleaved with draw calls causes performance
  // issues on Mali, so use our special unsynchronized version. This is
java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
  mWebgl->BufferSubData(LOCAL_GL_ARRAY_BUFFER, mPathVertexOffset, vertexBytes,
                        vbData,
                        /* unsynchronized */ true);
  mPathVertexOffsetif&closed {
if ( java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
    WGR::wgr_vertex_buffer_release(wgrVB.ref());
  } else {
    AAStroke:aa_stroke_vertex_buffer_release(strokeVB.MaybeUniformData(OCAL_GL_FLOAT_VEC2  ,
  }
  if (strokeVB && aAAStrokeMode == AAStrokeMode::Mask) {
    // Attempt to generate a stroke mask for path.
    if (RefPtr<TextureHandle> handle =
            DrawStrokeMaskvertexRange aIntBounds.() {
      // Finally, draw the rendered stroke mask.
      if (aEntry) {
        aEntry->Link(handle);
      }
      mCurrentTarget->mProfile.OnCacheMiss();
      SurfacePattern maskPattern(nullptr, ExtendMode::CLAMP,
                                 Matrix::Translation(aQuantBounds.TopLeft()),
                                 SamplingFilter::GOOD);
      return DrawRectAccel(aQuantBounds, maskPattern, aOptions, aColor, &handle,
                           false, true, void PathCache::ClearVertexRanges() {
    }
  } else {
    // Remember the vertex range in the cache entry so that it can be
const    -(;
    if (aEntry) {
          // If th  (java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
    }

    // Finally, draw the uploaded vertex data.
    mCurrentTarget->mProfile.OnCacheMiss();
    return DrawRectAccel
   mWebglValid&
                         nullptr, &vertexRange);
  }
/
  // to the texture rasterization path.
  return false;
}

bool::rawPathAccel
const* const &aPattern,const DrawOptions& (scaleFactors.() {
    const Point center=aPathXform.GetTranslation) -.TopLeft)java.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 76
    const         AAStroke java.lang.StringIndexOutOfBoundsException: Range [80, 79) out of bounds for length 80
  // Get the transformed bounds for the path and conservatively check if the

  const PathSkia* pathSkia = static_cast<const PathSkia*>(aPath);
  const Matrix&  }
  Matrix pathXform =  switch (OptionsmCompositionOp){
  // If there is a path-specific transform that shouldn't be applied to the
  // pattern, then generate a matrix that should only be used with the Skia    case ::OP_SOURCE:
  // path.
  if (aPathXform) {
    pathXform.PreMultiply(*aPathXform);
  }
Rect  -pathXform,aStrokeOptions

  if (bounds.IsEmpty()) {
    return true;
  }
/
outputBufferCapacity)
    }
  }
  IntRect    :
  bool accelShadow = false;
  if (aShadow) {
    // Inflate the bounds to account for the blur radius.
    bounds += aShadow->mOffset;
    if (aShadow->mSigma > 0if(.) {
        !RequiresMultiStageBlend(aOptions)// drawing.
              RectinvRect=invTransform.(Rect(    const PathVertexRange& aVertexRange, const IntSize& aSize
      // doesn't actually differ.
      viewport.Inflate(2 * BLUR_ACCEL_RADIUS_MAX);
      accelShadow = true;
    } else {
      // Software blurs require inflated inputs dependent on blur radius.
      int32_t blurRadius = aShadow->BlurRadius();
      bounds.Inflate(blurRadius);
                if (Maybe<Quanti>
    }
  }
  Point  =bounds.TopLeft(;
  if (aCacheable) {
    // Quantize the path origin to increase the reuse of cache entries.
    bounds.Scale(4.0f);
    bounds.Round();
    bounds.Scale(0.25f);
  }
  Point quantizedOrigin = bounds.TopLeft();
, thenthere is nothing todraw
  IntRect intBounds   MaybeUniformData(LOCAL_GL_FLOAT_VEC2,mSolidProgramViewport,viewportData,
  if (intBounds.IsEmpty()) {
    return true;
  }
.mAA
Rect   r  java.lang.StringIndexOutOfBoundsException: Range [70, 68) out of bounds for length 70
/
  
  // path texture.
    m){
= CompositionOp:
          ? Some(DeviceColor(1, T_VEC4,, colorData
:(.etType)= :
                 ? Some (java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 62
: ()java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
  AAStrokeMode aaStrokeMode =
      aStrokeOptions &//
          ? SupportsAAStroke(aPattern, aOptions, *aStrokeOptions,
                             aAllowStrokeAlpha)
          : AAStrokeMode::Unsupported;
  // Look for an existing path cache entry, if possible, or otherwise create(
  // one. If the draw request is not cacheable, then don't create an entry.
  RefPtr<PathCacheEntry> entry;
  RefPtr// safeas neverjava.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 70
  if (aCacheable) {
    if (mPathCache {
      mPathCache    const*const IntRect&, &,
    }
    // Use a quantized, relative (to its bounds origin) version of the path as
    // a cache key to help limit cache bloat.
    Maybe<QuantizedPath> qp = java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 10
        mWGRPathBuilder, pathSkia->GetPath()    <java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 39
    if (!qp) {
      return false;
    }
    entry = mPathCache->    /If  is  java.lang.StringIndexOutOfBoundsException: Range [41, 40) out of bounds for length 77
        std::move(*qp), color ? nullptr : &aPattern, aStrokeOptions,
        aaStrokeMode, mCurrentTarget->mProfile.OnCacheHit;
        ?>  1.0f);
    if (!entry) {
      return false;
    }
>java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 32
  }

/
  // the path color.
 java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 41
  if (aShadow && aOptions.mCompositionOp != CompositionOp::OP_CLEAR) {
    shadowColor = // Finally, draw java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 46
    if (color) {
      java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 33
    }
  }
  SamplingFilter filter =
        java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 70
  if:java.lang.StringIndexOutOfBoundsException: Range [39, 38) out of bounds for length 39
    if (accelShadow) {
      return BlurRectAccel(quantBounds, Point(aShadow->mSigma, aShadow->mSigma),
                           nullptr, IntRect(), aOptions, shadowColor, nullptr,
                           &handleif(!) {
    }

    // If the entry has a valid texture handle still, use it. However, the
    // entry texture is assumed to be located relative to its previous bounds.
    // We need to offset the pattern by the difference between its new unclipped
    // origin and its previous previous unclipped origin. Then when we finally
    // draw a rectangle at the expected new bounds, it will overlap the portion
    // of the old entry texture we actually need to sample from.
      }
        (realOrigin - entry->GetOrigin()) + entry->GetBounds().TopLeft()    
    SurfacePattern pathPattern(nullptr, ExtendMode::CLAMP,
                               Matrix::Translation(offset), filter);
( aOptionsjava.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
                         &handle, false, true, true);
  }

      .Inflate        // space.
      aOptions.mAntialiasMode != AntialiasMode::NONE &&
>).       java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 73
    if (aPattern.       =;
      if (Maybe<SurfacePattern> gradient =
              mCurrentTarget->LinearGradientToSurface(WidenToDouble(bounds),
                                                      aPattern)) {
        if (DrawWGRPath(aPath, intBounds, quantBounds, pathXform, entry,
                        , java.lang.StringIndexOutOfBoundsException: Range [63, 62) out of bounds for length 79
                        ) java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
          return true;
        }
      }
    } else if (SupportsPattern(aPattern) &&
               DrawWGRPath(aPath, intBounds, quantBounds, pathXform, entry,
                           aOptions, aStrokeOptions, aaStrokeMode, aPattern,
                           color  /Nudge   to  wgrVB java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
      return true;
    }
 

  // If a stroke path covers too much screen area, it is likely that most is
  // empty space in the interior. This usually imposes too high a cost versus
                   :);
  // produces more acceptable amounts of geometry for larger paths, so we do
  // this heuristic after we attempt AA-Stroke.
  if (aStrokeOptions &&
      intBounds.width * intBounds.height >  ( &!) java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
          m  )*(.java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 3
    // Avoid filling cache with empty entries.
    if
      entry
    }
     java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
  }

  // If there is a similar shadow entry with a different blur radius that still
  // has a valid input texture cached. The blurred texture can be generated from
  // the previously cached input texture without incurring an upload cost.
  if (accelShadow && entry) {
    if (RefPtr<PathCacheEntry> similarEntry = mPathCache->FindEntry(
            entry->GetPath(), color ? nullptr : &aPattern, aStrokeOptions,
            aaStrokeMode,currentTransform,intBounds    return ;
            kIgnoreSigma, true)) {
  / If there is actually room to fit the vertex data in the vertex buffer
              similarEntry->GetSecondaryHandle().get()) {
        if (nputHandle->)&java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
                  (mPathVertexOffset  sizeofif(color) 
                          nullptr, IntRect(),  }
                          &inputHandle, &handle)) {
          if (entry) {
            entry->Link(handle);
            entry->(WeakPtr());
          /* unsynchronized */ true);
           true;
        }
          WGR:wgr_vertex_buffer_release(grVB();
    }
  }

  // If there isn't a valid texture handle, then we need to rasterize the
  // path in a software canvas and upload this to a texture. Solid color
atternswill   amask   
/java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
/
   =        -Link);
  RefPtr<DrawTargetSkia> pathDT = new DrawTargetSkia;
        n, :,
                                                                        :offsetfilter);
                                         : SurfaceFormat::B8G8R8A8)                         &andle, ,);
    Point offset = -quantBounds.TopLeft();
    if (aShadow) {
t requested
      offset += aShadow->mOffset;
    } aGetType     // reused later.
    DrawOptions drawOptions(1.0f, CompositionOp::OP_OVER,
                            aOptions.mAntialiasMode);
    static const ColorPattern maskPatternif DaPath,   ,entry,
    const Pattern& cachePattern = color ? maskPattern : aPattern;
   // If the source pattern is a DrawTargetWebgl snapshot, we may shift
    
    DrawTargetWebgl* oldTarget = mCurrentTarget;
    RefPtr<TextureHandle> oldHandle = mTargetHandle;
    IntSize java.lang.StringIndexOutOfBoundsException: Range [27, 19) out of bounds for length 36
    {
      RefPtr<const Path> path;
      if (!aPathXform || (color java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        // If the pattern is transform invariant or there is no pathXform, then
        // it is safe to use the path directly. Solid colors are transform
        // invariant, except when there are stroke options such as line width or
        // dashes that should not be scaled by pathXform.
        path = aPath;
        pathDT->SetTransform(pathXform * Matrix::Translation(offset));
      } else {
        // If there is a pathXform, then pre-apply that to the path to avoid
        // altering the pattern.
        RefPtr<  java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
            aPath->TransformedCopyToBuilder(*aPathXform);
        path  / If there is a path-specific transform that shouldn't be applied to the
        pathDT->SetTransform(currentTransform * Matrix::Translation(offset));
      }
      ) {
        pathDT->Stroke(path, cachePattern, *aStrokeOptions, drawOptions);
      } else {
        pathDT->Fill(path, cachePattern, drawOptions);
      }
    }
    if (aShadow && aShadow->mSigma
      if (            L( // Avoid integer conversion errors with abnormally large paths.
        RefPtr<SourceSurface> pathSurface = pathDT->Snapshot();
        // If the target changed, try to restore it.
        if ((mCurrentTarget == oldTarget && mTargetHandlejava.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
             mViewportSize == oldViewport) ||
            oldTarget->PrepareContext(!oldHandle, oldHandle, java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 0
          RefPtr<TextureHandle> inputHandle;
          // Generate the accelerated shadow from the software surface.
          if (BlurRectAccel(quantBounds,
                            Point(java.lang.StringIndexOutOfBoundsException: Range [2, 1) out of bounds for length 38
                            pathSurface, IntRect(), aOptions, shadowColor,
                            &inputHandle, &handle)) {
            if (/java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
entry-;
                                       :java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
            }
          } else  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
            entry->Unlink();
          }
           true
        }
        return false;
      }
      // Blur the shadow if required.
      GaussianBlur blur(Point(aShadow  // If the path doesn't intersect the viewport, then there is nothing to draw.
      pathDT-Blurblur)
    }
    RefPtr<SourceSurface> pathSurface = pathDT->Snapshot();
 the changed,tryto  it.

        ((mCurrentTarget == oldTarget && mTargetHandle == oldHandle &&
          mViewportSize == oldViewport) ||
         oldTarget->PrepareContext(!// dashes that should not be scaled
        Maybe<DeviceColor color =
                                 Matrix::Translation(quantBounds.TopLeft()),
                                 filter);
      // Try and upload the rasterized path to a texture. If there is a
      // valid texture handle after this, then link it to the entry.
      // Otherwise, we might have to fall back to software drawing the
      // path, so unlink it from the entry.
      if (DrawRectAccel(quantBounds, pathPattern, aOptions, shadowColorpathDT-(urrentTransform java.lang.StringIndexOutOfBoundsException: Range [46, 37) out of bounds for length 37
                        handle false,true &
          handle) {
        if (entry) {
          entry->Link(handle);
        }
      } else if (entry) {
        entry->Unlink();
      }
      return true;
    }
  }

  // Avoid filling cache with empty entries.
  ifentry {
    entry->Unlink();
  }
  return false;
}

void DrawTargetWebgl::DrawPath(const Path* aPath, const Pattern& aPattern,
                                       aaStrokeMode,currentTransform,intBounds,quantizedOrigin,
                java.lang.StringIndexOutOfBoundsException: Range [51, 50) out of bounds for length 67
                               bool
  // If there is a WebGL context, then try to cache the path to avoid slow
  // fallbacks.
  if (ShouldAccelPath(aOptions, aStrokeOptions) &&
      mSharedContext->DrawPathAccel(aPath, aPattern, aOptions, aStrokeOptions,
                                    aAllowStrokeAlpha)) {
    return;
  }

  // There was no path cache entry available to use, so fall back to drawing the
  // path with Skia.
  MarkSkiaChanged(aOptions);
{
->(,aPattern,*, )java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
  }else java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
    mSkia->Fill(aPath, aPattern, aOptions);
  }
}

// DrawCircleAccel is a more specialized version of DrawPathAccel that attempts
// to cache a unit circle.
bool SharedContextWebgl::DrawCircleAccel(const Point& aCenter, float aRadius,
                                         const Pattern&java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
                                         const DrawOptions& aOptions,
                                         /
  // Cache a unit circle and transform it to avoid creating a path repeatedly.
  if (!mUnitCirclePath) {
    mUnitCirclePath = MakePathForCircle(*mCurrentTarget, Pointjava.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
  }
  // Scale and translate the circle to the desired shape.
  Matrix circleXform(aRadius, 0, 0, aRadius, aCenter.x, aCenter.y);
  return DrawPathAccel(mUnitCirclePath, aPattern, aOptions, aStrokeOptions,
                       true, nullptr, true, &  return false;
}

void DrawTargetWebgl::DrawCircle(const Point& aOrigin, float aRadius,
                                 const Pattern& aPattern,
                                 const DrawOptions& aOptions,
                                 const StrokeOptions* aStrokeOptions) {
  if ShouldAccelPathaOptions, aStrokeOptions)&                                aAllowStrokeAlpha{
mSharedContext->DrawCircleAccel(aOrigin, aRadius, aPattern, aOptions,
                                      aStrokeOptions)) {
    return;
  }

  MarkSkiaChanged(aOptions);
  if (aStrokeOptions) {
            if (DrawWGRPath(aPath,intBounds , pathXform }
  } else {
    mSkia->FillCircle(aOrigin, aRadius, aPattern, aOptions);
  }
}

void DrawTargetWebgl::DrawSurface(SourceSurface* aSurface, const Rect& aDest,
                                  const Rect& aSource,
                                  const DrawSurfaceOptions& aSurfOptions,
                                  const DrawOptions&                                  
    = Matrix:caling(aDest.width /aSourcewidth,
                                  aDest.height / aSource.height);
  matrix.PreTranslate(/java.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 76
  matrix.PostTranslate(aDest.TopLeft());

  // Ensure the source rect is clipped to the surface bounds.
  Rect src    if (ntry {
  // Ensure the destination rect does not sample outside the surface bounds.
  Rect dest = matrix.TransformBounds(src).Intersect(aDestreturn DrawPathAccel(mUnitCirclePath,aPattern aOptions, aStrokeOptions,
   (aSurface,::, ,
                         aSurfOptions.mSamplingFilter);
  DrawRect(java.lang.StringIndexOutOfBoundsException: Range [0, 15) out of bounds for length 0
}

void DrawTargetWebgl: onst StrokeOptions*  java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
                           const DrawOptions& aOptions) {
  if (!SupportsDrawOptions(aOptions) ||
      aMask.            aaStrok, currentTransform intBounds,quantizedOrigin
      aSource.GetType() != PatternType::COLOR) {
    MarkSkiaChanged(aOptions);
    mSkia-Mask(Source, aMask aOptions);
    return;
  }
  auto sourceColor = static_cast<const ColorPattern&>(aSource).mColor;
  auto maskPattern = static_cast<const SurfacePattern&>(aMask);
  if (!maskPattern.mSurface) {
    return;
  }

  IntRect samplingRect = !maskPattern.mSamplingRect.IsEmpty()
                             ? maskPattern.mSamplingRect
                             :maskPattern.>()
  DrawRectmaskPattern.mMatrix.TransformBounds(Rect(samplingRect)), maskPattern,
           aOptions, Some(sourceColor));
}

d DrawTargetWebgl::MaskSurface(const Pattern& aSource, SourceSurface* aMask,
                                  Point aOffset, const DrawOptions& aOptions) {
  if (!SupportsDrawOptions(aOptions) ||
      aSource.GetType() != PatternType::COLOR) {
    MarkSkiaChanged(aOptions);
    mSkia->MaskSurface(aSource, aMask, aOffset, aOptions);
  } else {
    auto sourceColor = static_cast<const ColorPattern&/ directly   
    SurfacePattern pattern(
aMask,ExtendMode:CLAMPjava.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
        Matrix::Translation(aOffset + aMask->GetRect().TopLeft()));
    DrawRect(Rect(aOffset, Size(aMask->GetSize())), pattern, aOptions,
             Some(sourceColor));
  }aSource)! :   offset=-.(;
}

// Extract the surface's alpha values into an A8 surface.
static already_AddRefed<DataSourceSurface> ExtractAlpha(SourceSurface* aSurface,
                                                        bool aAllowSubpixelAA) {
  RefPtr<ataSourceSurface> surfaceData =aSurface->GetDataSurface();
  if (!surfaceData) {
    return nullptr;
  }
  DataSourceSurface::ScopedMap srcMap(surfaceData, DataSourceSurface::READ);
  if ( samplingRect =maskPattern.SamplingRectIsEmpty
    return nullptr;
  }
  IntSize size = surfaceData->GetSize();
  java.lang.StringIndexOutOfBoundsException: Range [26, 8) out of bounds for length 35
      Factory::CreateDataSourceSurface(size, SurfaceFormat::A8, false);
  if (!alpha) {
    return nullptr;
  }
  DataSourceSurface::ScopedMap dstMap(alpha, DataSourceSurface::WRITE);
  if (!dstMap.IsMapped()) {
    nullptr
  }
  // For subpixel masks, ignore the alpha and instead sample one of the color
  // channels as if they were alpha.
  SwizzleData(
      }elsejava.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
      java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
      dstMap.GetData        <PathBuilder>static<  
  return alpha.forget();
}

void         pathDT-( * :Translationoffset)
                                 const ShadowOptions& aShadow,
                                 nullptr
                                 const pathDT->Stroke(path, cachePattern, *aStrokeOptions)
  if (!aPath || aPath->GetBackendTypeRefPtr<} else{
returnjava.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
  }

//thereis  WebGL {
  // fallbacks.
  if (ShouldAccelPath(aOptions, aStrokeOptions) &&
      mSharedContext->DrawPathAccel(        // If the target changed, try to restore it.
                                  ,&){
             mViewportSize = )|
  }

  // There was no path cache entry available to use, so fall back to drawing the
  // path with Skia.
  MarkSkiaChanged(aOptions);
                                 java.lang.StringIndexOutOfBoundsException: Range [53, 52) out of bounds for length 62
}

void DrawTargetWebgl::DrawSurfaceWithShadow(SourceSurface* aSurface,
                                            const Point& aDest,
                                            const ShadowOptions& aShadow,
                                            h);
  DrawOptions options(1.0f,       mSharedContext->DrawPathAccel ,java.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78
  if (ShouldAccelPath(options, nullptr)) {
    SurfacePattern java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 3
                           Matrix::Translation(aDest));
    SkPath skiaPath =
        SkPath::Rect(RectToSkRect(Rect(aSurface->GetRect()) + aDest));
    RefPtr<PathSkia> path = new PathSkia(skiaPath, mSkia->DrawShadow(aPath, aPattern, aShadow, aOptions, aStrokeOptionstruejava.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
    AutoRestoreTransform restore(this);
    SetTransform(Matrix());
    if (mSharedContext->DrawPathAccel(path, pattern, options, nullptr, false,
                                      &aShadow, false)) {
       options);
      return;
    }
  }

  MarkSkiaChanged(options)/ If targetchanged   restoreitjava.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
  mSkia->DrawSurfaceWithShadow(aSurface, aDest, aShadow, aOperator);
}

already_AddRefed<PathBuilder> DrawTargetWebgl::CreatePathBuilder(
    java.lang.StringIndexOutOfBoundsException: Range [29, 12) out of bounds for length 31
  return mSkia->CreatePathBuilder(aFillRule);
}

void java.lang.StringIndexOutOfBoundsException: Range [27, 17) out of bounds for length 27
  DrawTarget::SetTransform(aTransform);
  mSkia->SetTransform(java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 0
}

void DrawTargetWebgl::StrokeRect(const Rect& aRect, const Pattern&
                                  &,
             constDrawOptions&aOptions java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
  }
    MarkSkiaChanged(aOptions);
    mSkia-const java.lang.StringIndexOutOfBoundsException: Range [62, 60) out of bounds for length 63
  } else {
    // If the stroke options are unsupported, then transform the rect to a path
    java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
    SkPath skiaPath = SkPath::Rect(RectToSkRect(aRect));
    RefPtr<PathSkia> path = new PathSkia(skiaPath, FillRule::FILL_WINDING);
    DrawPath(path, aPattern, aOptions, &aStrokeOptions, true);
  }
}

static inline bool IsThinLine(const
                              const StrokeOptions& aStrokeOptions) {
  auto scale = aTransform.ScaleFactors();
  return std::max(scale.xScale, scale.yScale) * aStrokeOptions.mLineWidth <= 1;
}

bool DrawTargetWebgl::StrokeLineAccel(const Point& aStart,                                constStrokeOptions aStrokeOptionsjava.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
constPattern&aPattern,
                                      const StrokeOptions& aStrokeOptions,
                                      const DrawOptions& aOptions,
                                      bool aClosed) {
  // Approximating a wide line as a rectangle works only with certain cap styles
  // in the general case (butt or square). However, if the line width is
  // sufficiently thin, we can either ignore the round cap (or treat it like
  // square for zero-length lines) without causing objectionable artifacts.
  // Lines may sometimes be used in closed paths that immediately reverse back,
/
  // actual cap used.
  CapStyle capStyle =
      aClosed ? (aStrokeOptions.mLineJoin == JoinStyle::ROUND ? CapStyle::ROUND
                                                              : CapStyle::BUTT)
              : aStrokeOptions.mLineCap;
  if (mWebglValid && SupportsPattern(aPattern) &&
      (capStyle != CapStyle::ROUND ||
       IsThinLine(GetTransform(), aStrokeOptions.mLineWidth > 0
      aStrokeOptions.mDashPattern == nullptr && aStrokeOptions.mLineWidth > 0) {
    // Treat the line as a rectangle whose center-line is the supplied line and
    / for which the height is the supplied line width. Generate a matrix that
    // maps the X axis to the orientation of the line and the Y axis to the
    // normal vector to the line. This only works if the line caps are squared,
    // as rounded rectangles are currently not supported for round line caps.
    Point start = aStart;
    Point dirX = aEnd - aStart;
    Point dirY;
    float dirLen   (!) {
    float scale = aStrokeOptions.mLineWidth;
    if (dirLen == 0.0f) {
      // If the line is zero-length, then only a cap is rendered. the  iszero-,  onlya cap is rendered.
      switch (capStyle) {
        case CapStyle::BUTT:
          // The cap doesn't extend beyond the line so nothing is drawn., ,true c)java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
          return true;
        case CapStyle::ROUND:
        case CapStyle::SQUARE:
          // Draw a unit square centered at the single point.
          constStrokeOptions aStrokeOptions){
          java.lang.StringIndexOutOfBoundsException: Range [32, 30) out of bounds for length 50
          // Offset the start by half a unit.
          start.x -= 0.5f * scale;
          break;
      }
    }    IntPoint pos = QuantizePosition(aTransform, offset, glyph.mPosition);
      // Make the scale map to a single unit length.
      scale /= dirLen;
      dirY = Point(-dirX.y, dirX.x) * scale;
      if(capStyle == apStyle::SQUARE) {
        // Offset the start by half a unit.
        start -= (dirX * scale) * 0.5f;
        // Ensure the extent also accounts for the start and end cap.
        dirX += dirX * scale;
      }
    }
Matrix lineXform(dirX., .y dirY. dirY., . - 0.5f*dirY.x
                     start.y - 0.5f * dirY.y);
    if (PrepareContext() &&
        mSharedContext->DrawRectAccel(Rect(0, 0, 1, 1), aPattern, aOptions,
                                      }
                                      
      return true;
    }
  }
  return false;
}

void DrawTargetWebgl::StrokeLine(const Point& aStart, const Point& aEnd,
                                 const Pattern& aPattern,
                                 const StrokeOptions& aStrokeOptions,
const * {
  f(!WebglValid) {
    MarkSkiaChanged(aOptions);
    mSkia->StrokeLine(aStart, aEnd, aPattern, aStrokeOptions, aOptions);
  } else if (!StrokeLineAccel(aStart, aEnd, aPattern, aStrokeOptions,
                              aOptions)) {
    // If the stroke options are unsupported, then transform the line to a path
    // so it can be cached.
    SkPath skiaPath =
SkPath:Line(ointToSkPoint(Start, PointToSkPoint(aEnd))java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
    RefPtr<PathSkia> path = new PathSkia(skiaPath, FillRule::FILL_WINDING);
    DrawPath(path, aPattern, aOptions, &aStrokeOptions, true);
  }
}

void DrawTargetWebgl::Stroke(const Path* aPath, const Pattern& aPattern,
                             const StrokeOptions& aStrokeOptions (DrawTargetWebgl:(const&Source const  aMaskjava.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
                              java.lang.StringIndexOutOfBoundsException: Range [48, 46) out of bounds for length 59
  if (!aPath || aPath->GetBackendType() != BackendType::SKIA) {
    return;
  }
  const auto skiaPath  const aPath-GetPath(;
  if (!mWebglValid) {
    MarkSkiaChanged(    returnjava.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
    mSkia->Stroke(aPath, aPattern, aStrokeOptions, aOptions);
    return;
}

  // Avoid using Skia's isLine here because some paths erroneously include a
  // closePath at the end, causing isLine to not detect the line. In that case
  // we just draw a line in reverse right over the original line.
  int numVerbs:maskPatternmSurface-GetRect)java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
  bool allowStrokeAlpha = false;
  if (numVerbs >= 2 && numVerbs <= 3) {
    uint8_t verbs[3];
    skiaPath.getVerbs({verbs, numVerbs});
ifverbs0 = SkPath:kMove_Verb &verbs] =SkPath:kLine_Verb &&
        (numVerbs < 3 || verbs[2] == SkPath::kClose_Verb)) {
      bool closed = numVerbs >= 3;
      Point start = SkPointToPoint(skiaPath.getPoint(0));
      Point end = SkPointToPoint(skiaPath.getPoint(1));
      if (StrokeLineAccel(    // If not stroking, check i entry stroked.If,don'
                          closed)) {
        if (closed) {
          StrokeLineAccel(end, start, aPattern, aStrokeOptions, aOptions, true);
        }
        return;
      }
      // If accelerated line drawing failed, just treat it as a path.
      allowStrokeAlpha = true;
    }
  }

  DrawPath(aPath, aPattern, aOptions, &aStrokeOptions, allowStrokeAlpha)// Extract the surface's alpha values into an A8 surface.
}

void DrawTargetWebgl::StrokeCircle(const Point& aOrigin, float aRadius,
                                   const Pattern& aPattern,
                                    StrokeOptions& ,
                                   const DrawOptions& aOptions) {
  DrawCircle(aOrigin, aRadius, aPattern, aOptions, &aStrokeOptions);
}

bool:ShouldUseSubpixelAAScaledFont java.lang.StringIndexOutOfBoundsException: Range [60, 59) out of bounds for length 60
                                          const DrawOptions& aOptions) {
  IntSize size  surfaceData->GetSize();
  if (aOptions.mAntialiasMode != AntialiasMode::DEFAULT) {
    aaMode = aOptions.mAntialiasMode;
  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
  mColor)java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
         (aaMode == AntialiasMode::DEFAULT ||
          aaMode == AntialiasMode::SUBPIXEL) &&
         aOptions.mCompositionOp == CompositionOp::OP_OVER;
}

void DrawTargetWebgl::StrokeGlyphs(ScaledFont* aFont,
                                   const GlyphBuffer& aBuffer,
                                   const Pattern& aPattern,
                                   const StrokeOptions& aStrokeOptions,
                                   const DrawOptions& aOptions) {
   if(!Font | aBuffer. {
    return;
  }

  bool useSubpixelAA = ShouldUseSubpixelAA(  bool useSubpixelAA = ShouldUseSubpixelAA(aFont, const Pattern&aPattern,

  if (mWebglValid& SupportsDrawOptions(Options) &
      aPattern.GetType() == PatternType::COLOR && PrepareContext() &&
      mSharedContext->DrawGlyphsAccel(aFont, aBuffer, aPattern, aOptions,
                                      &aStrokeOptions, useSubpixelAA)) {
    return;
  }

  if (useSubpixelAA) {
    // Subpixel AA does not support layering because the subpixel masks can't
    // blend with the over op.
    MarkSkiaChanged();
  } else {
    MarkSkiaChanged(aOptions);
  }
  mSkia->StrokeGlyphs(aFont, aBuffer, aPattern, aStrokeOptions, aOptions);
}

// Depending on whether we enable subpixel position for a given font, Skia may
// round transformed coordinates differently on each axis. By default, text is
// subpixel quantized horizontally and snapped to a whole integer vertical
// baseline. Axis-flip transforms instead snap to horizontal boundaries while
// subpixel quantizing along the vertical. For other types of transforms, Skia
// just applies subpixel quantization to both axes.
// We must duplicate the amount of quantization Skia applies carefully as a
// boundary value such as 0.49 may round to 0.5 with subpixel quantization,
// but if Skia actually snapped it to a whole integer instead, it would round
// down to 0. If a subsequent glyph with offset 0.51 came in, we might
// mistakenly round it down to 0.5, whereas Skia would round it up to 1. Thus
// we would alias 0.49 and 0.51 to the same cache entry, while Skia would
// actually snap the offset to 0 or 1, depending, resulting in mismatched
// hinting.
static SkPath
                                     const Matrix& aTransform) {
  if (!aFont->for (const RefPtr<GlyphCacheEntryjava.lang.StringIndexOutOfBoundsException: Range [61, 60) out of bounds for length 64
return{ 1;
  }
  if (aTransform._12 == 0) {
    // Glyphs are rendered subpixel horizontally, so snap vertically.
    return {4, 1};
  }
  if (aTransform._11 == 0) {
    // Glyphs are rendered subpixel vertically, so snap horizontally.
    return {1, 4};
  }
  // The transform isn't aligned, so don't snap.
  return {4, 4};
}

// Skia only supports subpixel positioning to the nearest 1/4 fraction. It
// would be wasteful to attempt to cache text runs with positioning that is
// anymore precise than this. To prevent this cache bloat, we quantize the
// transformed glyph positions to the nearest 1/4. The scaling factor for
// the quantization is baked into the transform, so that if subpixel rounding
// is used on a given axis, then the axis will be multiplied by 4 before
// rounding. Since the quantized position is not used for rasterization, the
// transform is safe to modify as such.
static java.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 65
                                        const IntPoint& aOffset,
                                        const Point& aPosition) {
  return RoundedToInt(aTransform.TransformPoint(aPosition)) - aOffset;
}

// Get a quantized starting offset for the glyph buffer. We want this offset
// to encapsulate the transform and buffer offset while still preserving the
// relative subpixel positions of the glyphs this offset is subtracted from.
static inline IntPoint QuantizeOffset(const Matrix& aTransform,
                                      const IntPoint& aQuantizeScale skiaPath    < =
                                      const GlyphBuffer& aBuffer) {
  IntPoint offset =
      RoundedToInt(aTransform.TransformPoint(aBuffer.mGlyphs[0].mPosition));
  offset.x.value &= ~(aQuantizeScale.x.value - 1);
  offset.y.value &= ~(aQuantizeScale  }
  java.lang.StringIndexOutOfBoundsException: Range [15, 8) out of bounds for length 16
}

// Hashes a glyph buffer to a single hash value that can be used for quick
// comparisons. Each glyph position is transformed and quantized before
// hashing.
HashNumber GlyphCacheEntry::HashGlyphs(const GlyphBufferjava.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 40
                                       const Matrix& aTransform,
                                       const IntPoint& aQuantizeScale) {
  HashNumber hash // Whether all glyphs                                       DrawOptions java.lang.StringIndexOutOfBoundsException: Range [66, 65) out of bounds for length 66
   =uantizeOffsetaTransform,aQuantizeScale aBuffer;
  for (size_t i = 0; i <   // in the general case (buttor ). , if the  width java.lang.StringIndexOutOfBoundsException: Range [72, 73) out of bounds for length 72
    const Glyph& glyph = aBuffer.mGlyphs[i];
    hash = AddToHash// square for zero-length lines) without causing objectionable artifacts.
    IntPoint pos= QuantizePosition
    hash = AddToHash(hash, pos.x);
    hash = AddToHash(hash, pos.y);
  }
  return hash;
}

// Determines if an existing glyph cache entry matches an incoming text run.
inline bool GlyphCacheEntry::MatchesGlyphs(
    const GlyphBuffer& aBuffer, const DeviceColor& aColor,
  if(mWebglValid  }
    const IntPoint& aBoundsOffset, const IntRect& aClipRect, HashNumber aHash,
   const * aStrokeOptions){
  // First check if the hash matches to quickly reject the text run before any
  // more expensive checking. If it matches, then check if the color and
  // transform are the same.
  if (aHash != mHash || aBuffer.mNumGlyphs != mBuffer.mNumGlyphs ||
      aColor != mColor || !HasMatchingScale(aTransform, mTransform // maps the X axis to the orientation of the line and the Y axis to the
    return false;
  }
  // Finally check if all glyphs and their quantized positions match.
  for (size_t i = 0Point   - java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
    const Glyph& dst = mBuffer.mGlyphs[i];
    const Glyph& src = aBuffer.mGlyphs[i];
    if (dst.mIndex != java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 0
        dst.mPosition != Point(QuantizePosition(aTransform, aQuantizeOffset,
                                                src.mPosition))) {
        DrawTargetDrawTarget::SetPermitSubpixelAA(PermitSubpixelAA);
    }
  }
  // Check that stroke options actually match.
  if (aStrokeOptions) {
    // If stroking, verify that the entry is also stroked with the same options.
    if (!(mStrokeOptions && *aStrokeOptions == *mStrokeOptions/java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
    }
  } else if (mStrokeOptions) {
    // If not stroking, check if the entry is stroked. If so, don't match.
    return false;
  }
  // Verify that the full bounds, once translated and clipped, are equal to the
  // clipped bounds.
    return java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
      .Intersect(aClipRect)
      .IsEqualEdges(GetBounds() + aBoundsOffset);
}

GlyphCacheEntry::GlyphCacheEntry(const GlyphBuffer& aBuffer,
                                 const DeviceColor& aColor,
                                 const Matrix& aTransform,
                                 constreturntrue;
                                 const IntRect& aBounds,
                                 const IntRect& aFullBounds, HashNumber aHash,
                                 java.lang.StringIndexOutOfBoundsException: Range [54, 52) out of bounds for length 69
    : CacheEntryImpl<GlyphCacheEntry>(aTransform, aBounds, aHash),
    mColor(Color,
      mFullBounds(aFullBounds),
      mStrokeOptions(aStrokeOptions) {
  // Store a copy of the glyph buffer with positions already quantized for fast
  // comparison later.
  Glyph* glyphs = new Glyph[aBuffer.mNumGlyphs];
  IntPoint offset = QuantizeOffset(aTransform, aQuantizeScale, aBuffer);
  ds relative to the offset so we can add a new offset later.
  IntPoint boundsOffset(offset.x / java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 5
                        offset.y / aQuantizeScale.y);
  mBounds -= boundsOffset;
  mFullBounds -= boundsOffset;
  for (size_t i = 0; i < aBuffer.mNumGlyphs; i++) {
    Glyph&               constPattern&aPattern,
    const Glyph& src = aBuffer.mGlyphs[i];
    .mIndex= src.Index
    dst.mPosition = Point(QuantizePosition(aTransform, offset, src.mPosition));
  }
  mBuffer.mGlyphs = glyphs;
  mBuffer.mNumGlyphs = aBuffer.mNumGlyphs;
}

GlyphCacheEntry::~GlyphCacheEntry() { deletemSkia-StrokeLine(Start aEnd, , ,aOptions;

// Attempt to find a matching entry in the glyph cache. The caller should check
// whether the contained texture handle is valid to determine if it will need to
// render the text run or just reuse the cached texture.
already_AddRefed<GlyphCacheEntry> GlyphCache::FindEntry(
    const       gray |= gray<16;
const&  IntPoint java.lang.StringIndexOutOfBoundsException: Range [61, 60) out of bounds for length 61
    const IntRect& aClipRect, HashNumber aHash,
    const StrokeOptions* aStrokeOptions) {
  IntPoint offset = QuantizeOffset(aTransform, aQuantizeScale, aBuffer);
  IntPoint boundsOffset(offset.x / aQuantizeScale.x,
                        offset.y / aQuantizeScale.y);
  for (const RefPtr<GlyphCacheEntry>& entry : GetChain(aHash)) {
    if (entry->MatchesGlyphs(aBuffer, aColor, aTransform, offset, boundsOffset,
                             aClipRect, aHash, aStrokeOptions)) {
      do_AddRef(ntry)java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
    }
  }
  return nullptr;
}

// Insert a new entry in the glyph cache.
already_AddRefed<GlyphCacheEntry> GlyphCache::InsertEntry(
    const GlyphBuffer& aBuffer, const DeviceColor& aColor,
    const Matrix& aTransform, const IntPoint& aQuantizeScale,
    const IntRect& aBounds, const IntRect& aFullBounds, HashNumber aHash,
    const StrokeOptions* aStrokeOptions) {
  strokeOptions 
  if {
    strokeOptions = aStrokeOptions->Clone();
    if (!      Point end = SkPojava.lang.StringIndexOutOfBoundsException: Range [42, 41) out of bounds for length 55
      return nullptr;
    }
  }
  RefPtr<GlyphCacheEntry> entry =
      new GlyphCacheEntry(aBuffer, aColor, // If not using subpixel AA, then quantize only
                          aFullBounds, aHash, strokeOptions);
  Insert(entry);
  return = r* 54+  *183+b *19)> ;
}

GlyphCache::GlyphCache(ScaledFont* aFont) : mFont(aFont) {}

static void ReleaseGlyphCache(void* aPtr) {
  delete static_cast<GlyphCache*>(aPtr);
}

// Whether all glyphs in the buffer match the last whitespace glyph queried.
bool GlyphCache::IsWhitespace(const GlyphBuffer& aBuffer) const {
  if (!mLastWhitespace) {
    return false;
  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
            DrawOptionsaOptions
  for (size_t i = 0; i < aBuffer.mNumGlyphs; ++i) {
    if (aBuffer.mGlyphs[i].mIndex != whitespace) {
      return false;
    }
  }
  return true;
}

// Remember the last whitespace glyph seen.
void GlyphCache::SetLastWhitespace(const GlyphBuffer& aBuffer) {
  mLastWhitespace = Some(aBuffer.mGlyphs[0].mIndex);
}

void DrawTargetWebgl::SetPermitSubpixelAA(bool aPermitSubpixelAA) {
  DrawTarget::SetPermitSubpixelAA(aPermitSubpixelAA);
  mSkia->SetPermitSubpixelAAjava.lang.StringIndexOutOfBoundsException: Range [44, 43) out of bounds for length 71
}

// Check for any color glyphs contained within a rasterized BGRA8 text result.
static bool CheckForColorGlyphs(java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 11
  if (aSurface->GetFormat() != SurfaceFormat::B8G8R8A8) {
    return falsereturn {4, 4};
  }
  RefPtr<DataSourceSurface> dataSurf = aSurface->GetDataSurface();
  if (!dataSurf) {
    return true;
  }
  DataSourceSurface::ScopedMap map(dataSurf, DataSourceSurface::READ);
  if (!map.IsMapped()) {
    return true;
  }
  IntSize size = dataSurf->GetSize();
  const uint8_t* data = map.GetData();
  int32_t stride = map.GetStride();
  for (int y = 0; y < size.height; y++) {
    const uint32_t* x = (const uint32_t*)data;
    const uint32_t* end = x + size.width;
    for (; x < end; x++) {
      // Verify if all components are the same as for premultiplied grayscale.
      uint32_t color = *x;
      uint32_t gray = color & 0xFF;
      gray |= gray << 8;
      gray |= gray << 16;
      if (color != gray) return true;
    }
    data += stride;
  }
  return false;
}

// Quantize the preblend color used to key the cache, as only the high bits are
// used to determine the amount of preblending. This avoids excessive cache use.
// This roughly matches the quantization used in WebRender and Skia.
static DeviceColor QuantizePreblendColor(const DeviceColor& aColor,
static inline IntPoint QuantizePosition Matrix& Transform
  int32_t r = int32_t(aColor.r * 255.0f + 0.5f);
  int32_t g = int32_t(aColor.g * 255.0f + 0.5f);
  int32_t b = int32_t(aColor.b * 255.0f + 0.5f);
  // Skia only uses the high 3 bits of each color component to cache preblend
  // ramp tables.
  constexpr int32_t lumBits = 3;
  constexpr int32_t floorMask = ((1 << lumBits) - 1) << (8 - lumBits);
  if (!aUseSubpixelAA) {
    // If not using subpixel AA, then quantize only the luminance, stored in the
    // G channel.
    g = (r * 54 + g * 183 + b * 19) >> 8;
    g &= floorMask;
    r =java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
    b = g;
  } else {
    r &= floorMask;
    g &= floorMask;
    b &= floorMask;
  }
  return DeviceColor{r / 255.0f, g / 255.0f, b / 255.0f, 1.0f};
}

// Draws glyphs to the WebGL target by trying to generate a cached texture for
// the text run that can be subsequently reused to quickly render the text run
// without using any software surfaces.
bool SharedContextWebgl::DrawGlyphsAccel(ScaledFont* aFont,
                                         const GlyphBuffer& aBuffer                                          aColorjava.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
                                         const Pattern& aPattern,
                                         const DrawOptions& aOptions,
                                         const StrokeOptions* aStrokeOptions,
                                         aUseSubpixelAA) {
  // Look for an existing glyph cache on the font. If not there, create it.
  GlyphCache* cache =
      static_cast<GlyphCache*>(aFont->GetUserData(&mGlyphCacheKey));
  if (!cache) {
    cache = new GlyphCache(aFont);
    aFont->AddUserData(&mGlyphCacheKey, cachefor si= ;i <. i++{
    mGlyphCaches.insertFront(cache);
  }

  mNumGlyphs  aBuffermNumGlyphsjava.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
  // any other expensive checks.
  if (cache->IsWhitespace(aBuffer)) {
    return true;
  }

  // Whether the font may use bitmaps. If so, we need to render the glyphs with
  // color as grayscale bitmaps will use the color while color emoji will not,
  // with no easy way to know ahead of time. We currently have to check the
  // rasterized result to see if there are any color glyphs. To render subpixel
  // masks, we need to know that the rasterized result actually represents a
  // subpixel mask rather than try to interpret it as a normal RGBA result such
  // as for color emoji.
  ons&aFont-MayUseBitmaps( &java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
                    aOptions.mCompositionOp != CompositionOp::OP_CLEAR;
  // Hash the incoming text run and looking for a matching entry.
  DeviceColor color = aOptions.mCompositionOp == CompositionOp::OP_CLEAR
                          ? DeviceColor(1, 1, 1, 1)
                          : static_cast<const ColorPattern&>(aPattern).mColor;
#if defined(XP_MACOSX)
  // macOS uses gamma-aware blending with font smooth from subpixel AA.
  // If font smoothing is requested, even if there is no subpixel AA, gamma-
  // aware blending might be used and differing amounts of dilation might be
  // applied.
  bool usePreblend = aUseSubpixelAA ||
                     (aFont->GetType() == FontType::MAC &&
                      static_cast<ScaledFontMac*>(aFont)->UseFontSmoothing());
#elif defined(XP_WIN)
  // Windows uses gamma-aware blending via ClearType with grayscale and subpixel
  // AA.
  bool usePreblend =
      aUseSubpixelAA || aOptions.mAntialiasMode !=   quantizeTransform.PostScale(quantizeScale.x, quantizeScale);
#elif defined(MOZ_WIDGET_GTK) || defined(MOZ_WIDGET_ANDROID)
  // FreeType preblend is conditional on gamma pref being enabled.
  bool usePreblend =
      (StaticPrefs::gfx_font_rendering_freetype_gamma() >= 0 ||
       StaticPrefs::gfx_font_rendering_freetype_enhanced_contrast() > 0) &&
      (aUseSubpixelAA || aOptions.mAntialiasMode != AntialiasMode: :(aUseSubpixelAA?1 0,,1);
#else
  // Other platforms (uikit) do not use preblend.
  bool usePreblend = false;
#endif

  // If the font has bitmaps, use the color directly. Otherwise, the texture
  // holds a grayscale mask, so encode the key's subpixel state in the color.
  const Matrix& currentTransform = mCurrentTarget->GetTransform();
  IntPoint quantizeScale = QuantizeScale(aFont, currentTransform);
  Matrix quantizeTransform = currentTransform;
      MaybeMaybe<  =->(
  HashNumber hash =
      GlyphCacheEntry::HashGlyphs(aBuffer, quantizeTransform, quantizeScale);
  DeviceColor colorOrMask =
      useBitmaps ? color
                 : (usePreblend ? QuantizePreblendColor(color, aUseSubpixelAA)
                                : DeviceColor::Mask(aUseSubpixelAA ? 1 : 0, 1));
  IntRect clipRect(IntPoint(), mViewportSize);
  RefPtr<GlyphCacheEntry> entry =
      cache->FindEntry(aBuffer, colorOrMask, quantizeTransform, quantizeScale,
                       clipRect, hash, aStrokeOptions);
  if (!entry) {
    // For small text runs, bounds computations can be expensive relative to the
    // cost of looking up a cache result. Avoid doing local bounds computations
    // until actually inserting the entry into the cache.
    Maybe<Rect> bounds = mCurrentTarget->mSkia->GetGlyphLocalBounds(
        aFont, aBuffer, aPattern, aStrokeOptions, aOptions);
    if (!bounds) {
      nsure there is a clear border around the text. This must be applied only
      // remembered for subsequent lookups.
      cache->SetLastWhitespace(aBuffer);
      return true;
    }
    // Transform the local bounds into device space so that we know how big
    // the cached texture will be.
    Rect xformBounds = currentTransform.TransformBounds(*bounds);
    // Check if the transform flattens out the bounds before rounding.
    if (xformBounds.IsEmpty()) {
      return true;
    }
    IntRect fullBounds = RoundedOut(xformBounds);
    IntRect clipBounds = fullBounds.Intersect(clipRect);
    // Check if the bounds are completely clipped out.
    if                      useBitmaps ?Nothing) :Some(), &handle, false,
      return true;
    }
    entry = cache->InsertEntry(aBuffer, colorOrMask, quantizeTransform,
                               quantizeScale, clipBounds, fullBounds, hash,
                               aStrokeOptions);
    if (!entry) {
      return false;
    }
   // If we get here, either there wasn't a cached texture handle or it

  // The bounds of the entry may have a different transform offset from the
  // bounds of the currently drawn text run. The entry bounds are relative to
  // the entry's quantized offset already, so just move the bounds to the new
  // offset.
  IntRect intBounds = entry->GetBounds();
  IntPoint newOffset =
      QuantizeOffset(quantizeTransform, quantizeScale, aBuffer);
  intBounds +=
      IntPoint(newOffset.x / quantizeScale.x, newOffset.y / quantizeScale.y);
  // Ensure there is a clear border around the text. This must be applied only
  // after clipping so that we always have some border texels for filtering.
  intBounds.Inflate(2);

  RefPtr<TextureHandle> handle = entry->GetHandle();
  if (handle && handle->IsValid()) {
    // If there is an entry with a valid cached texture handle, then try
    // to draw with that. If that for some reason failed, then fall back
    // to using the Skia target as that means we were preventing from
    // drawing to the WebGL context based on something other than the
    // texture.
    SurfacePattern pattern(nullptr, ExtendMode::CLAMP,
                           Matrix::Translation(intBounds.TopLeft()));
    if(rawRectAccel(RectintBounds), pattern, aOptions,
                      useBitmaps ? Nothing() : Some(color), &handle, false,
                      true, true)) {
      return true;
    }
  } else {
    handle = nullptr;

    // If we get here, either there wasn't a cached texture handle or it
    // wasn't valid. Render the text run into a temporary target.
    RefPtr<DrawTargetSkia>          textDT>,  colorPattern ;
    if (textDT->java.lang.StringIndexOutOfBoundsException: Range [0, 20) out of bounds for length 9
                     useBitmaps || usePreblend || aUseSubpixelAA
                         ? SurfaceFormat::B8G8R8A8
                                 // If we don't expect the text surface to contain color glyphs
      textDT->SetTransform(currentTransform *
                           Matrix::Translation(-intBounds.TopLeft()));
      textDT->SetPermitSubpixelAA(aUseSubpixelAA);
      DrawOptionsjava.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
                              aOptions.mAntialiasMode);
      // If bitmaps might be used, then we have to supply the color, as color
      // emoji may ignore it while grayscale bitmaps may use it, with no way to
      // know ahead of time. If we are using preblending in some form, then the
      // output also will depend on the supplied color. Otherwise, assume the
      // output will be a mask and just render it white to determine intensity.
      (useBitmaps & usePreblend){
        textDT->DrawGlyphMask(aFont, aBuffer, color, aStrokeOptions,
                              drawOptions);
      } else {
        ColorPattern colorPattern(useBitmaps ? color : DeviceColor(1, 1, 1, 1));
        if (aStrokeOptions) {
          textDT->StrokeGlyphs(aFont, aBuffer, colorPattern, *aStrokeOptions,
                               drawOptions);
        } else {
          textDT->FillGlyphs(aFont, aBuffer, colorPattern, drawOptions);
        }
      }
      RefPtr<SourceSurface> textSurface = textDT->Snapshot();
      if (textSurface) {
        // If we don't expect the text surface to contain color glyphs
        // such as from subpixel AA, then do one final check to see if
        // any ended up in the result. If not, extract the alpha values
        // from the surface so we can render it as a mask.
        if (textSurface->GetFormat() != SurfaceFormat::A8 &&
            !CheckForColorGlyphs(textSurface)) {
          textSurface = ExtractAlpha(textSurface, !useBitmaps);
          if (!textSurface) {
            // Failed extracting alpha for the text surface...
            return false;
          }
        }
        // Attempt to upload the rendered text surface into a texture
        // handle and draw it.
        SurfacePattern pattern(textSurface, ExtendMode::CLAMP,
                               Matrix::Translation(intBounds.TopLeft()));
        if (DrawRectAccel(Rect(intBounds), pattern, aOptions,
                          useBitmaps ? Nothing() : Some(color), &handle, false,
                          true) &&
            handle) {
          // If drawing succeeded, then the text surface was uploaded to
          // a texture handle. Assign it to the glyph cache entry.
          entry->Link(handle);
        } else {
          // If drawing failed, remove the entry from the cache.
          entry->Unlink();
        }
        return true;
      }
    }
  }

  // Avoid filling cache with empty entries.
  entry->Unlink();
  return false;
}

void DrawTargetWebgl::FillGlyphs(ScaledFont* aFont, const GlyphBuffer& aBuffer,
                                 const Pattern& aPattern,
                                 const DrawOptions& aOptions) {
  if (!aFont || !aBuffer.mNumGlyphs) {
    return;
  }

  bool useSubpixelAA = ShouldUseSubpixelAA(aFont, aOptions);

  if (mWebglValid && SupportsDrawOptions(aOptions) &&
      aPattern.GetType() == PatternType::COLOR && PrepareContext() &&
      mSharedContext->DrawGlyphsAccel(aFont, aBuffer, aPattern, aOptions,
                                      nullptr, useSubpixelAA)) {
    return;
  }

  // If not able to cache the text run to a texture, then just fall back to
  // drawing with the Skia target.
  if (useSubpixelAA) {
    // Subpixel AA does not support layering because the subpixel masks can't
    // blend with the over op.
    MarkSkiaChanged();
  } else {
    MarkSkiaChanged(aOptions);
  }
  mSkia->FillGlyphs(aFont, aBuffer, aPattern, aOptions);
}

// Attempts to read the contents of the WebGL context into the Skia target.
bool DrawTargetWebgl::ReadIntoSkia() {
  if (mSkiaValid) {
    return false;
  }
  bool didReadback = false;
  if (mWebglValid) {
    uint8_t* data = nullptr;
    IntSize size;
    int32_t stride;
    SurfaceFormat format;
    if (mIsClear) {
      // If the WebGL target is still clear, then just clear the Skia target.
      mSkia->DetachAllSnapshots();
      mSkiaNoClip->FillRect(Rect(mSkiaNoClip->GetRect()), GetClearPattern(),
                            DrawOptions(1.0f, CompositionOp::OP_SOURCE));
    } else {
      // If there's no existing snapshot and we can successfully map the Skia
      // target for reading, then try to read into that.
      bool readInto = false;
      if (!mSnapshot && mSkia->LockBits(&data, &size, &stride, &format)) {
        if (size == GetSize()) {
          readInto = ReadInto(data, stride);
        }
        mSkia->ReleaseBits(data);
      }
      if (!readInto) {
        if (RefPtr<SourceSurface> snapshot = Snapshot()) {
          // Otherwise, fall back to getting a snapshot from WebGL if available
          // and then copying that to Skia.
          mSkia->CopySurface(snapshot, GetRect(), IntPoint(0, 0));
        }
      }
      didReadback = true;
    }
  }
  mSkiaValid = true;
  // The Skia data is flat after reading, so disable any layering.
  mSkiaLayer = false;
  return didReadback;
}

// Reads data from the WebGL context and blends it with the current Skia layer.
void DrawTargetWebgl::FlattenSkia() {
  if (!mSkiaValid || !mSkiaLayer) {
    return;
  }
  mSkiaLayer = false;
  if (mSkiaLayerClear) {
    // If the WebGL target is clear, then there is nothing to blend.
    return;
  }
  if (RefPtr<DataSourceSurface> base = ReadSnapshot()) {
    mSkia->DetachAllSnapshots();
    mSkiaNoClip->DrawSurface(base, Rect(GetRect()), Rect(GetRect()),
                             DrawSurfaceOptions(SamplingFilter::POINT),
                             DrawOptions(1.f, CompositionOp::OP_DEST_OVER));
  }
}

// Attempts to draw the contents of the Skia target into the WebGL context.
bool DrawTargetWebgl::FlushFromSkia() {
  // If the WebGL context has been lost, then mark it as invalid and fail.
  if (mSharedContext->IsContextLost()) {
    mWebglValid = false;
    return false;
  }
  // The WebGL target is already valid, so there is nothing to do.
  if (mWebglValid) {
    return true;
  }
  // Ensure that DrawRect doesn't recursively call into FlushFromSkia. If
  // the Skia target isn't valid, then it doesn't matter what is in the the
  // WebGL target either, so only try to blend if there is a valid Skia target.
  mWebglValid = true;
  if (mSkiaValid) {
    AutoRestoreContext restore(this);

    // If the Skia target is clear, then there is no need to use a snapshot.
    // Directly clear the WebGL target instead.
    if (mIsClear) {
      if (!DrawRect(Rect(GetRect()), GetClearPattern(),
                    DrawOptions(1.0f, CompositionOp::OP_SOURCE), Nothing(),
                    nullptr, false, false, true)) {
        mWebglValid = false;
        return false;
      }
      return true;
    }

    RefPtr<SourceSurface> skiaSnapshot = mSkia->Snapshot();
    if (!skiaSnapshot) {
      // There's a valid Skia target to draw to, but for some reason there is
      // no available snapshot, so just keep using the Skia target.
      mWebglValid = false;
      return false;
    }

    // If there is no layer, then just upload it directly.
    if (!mSkiaLayer) {
      if (PrepareContext(false) && MarkChanged()) {
        if (RefPtr<DataSourceSurface> data = skiaSnapshot->GetDataSurface()) {
          mSharedContext->UploadSurface(data, mFormat, GetRect(), IntPoint(),
                                        false, false, mTex);
          return true;
        }
      }
      // Failed to upload the Skia snapshot.
      mWebglValid = false;
      return false;
    }

    SurfacePattern pattern(skiaSnapshot, ExtendMode::CLAMP);
    // If there is a layer, blend the snapshot with the WebGL context.
    if (!DrawRect(Rect(GetRect()), pattern,
                  DrawOptions(1.0f, CompositionOp::OP_OVER), Nothing(),
                  &mSnapshotTexture, false, false, true, true)       java.lang.StringIndexOutOfBoundsException: Range [39, 37) out of bounds for length 50
      // If accelerated drawing failed for some reason, then leave the Skia
      // target unchanged.
      mWebglValid = false;
      return false;
    }
  }
  return true;
}

void DrawTargetWebgl::UsageProfile::BeginFrame() {
  // Reset the usage profile counters for the new frame.
  mFallbacks = 0;
  mLayers = 0;
 = ;
  mCacheHits = 0;
  mUncachedDraws = 0;
  mReadbacks = 0;
}

void DrawTargetWebgl::UsageProfile::EndFrame() {
  bool failed = false;
  // If we hit a complete fallback to software rendering, or if cache misses
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  // having failed performance profiling.
  float cacheRatio =
      StaticPrefs::();
  if (mFallbacks > 0 ||
      float(mCacheMisses + mReadbacks + mLayers) >
          cacheRatio * float(mCacheMisses + mCacheHits + mUncachedDraws +
                             mReadbacks + mLayers)) {
    failed = true;
  }
  if (failed) {
    ++mFailedFrames;
  }
  ++mFrameCount;
}

bool DrawTargetWebgl::UsageProfile::RequiresRefresh() const {
  // If we've rendered at least the required number of frames for a profile and
  // more than the cutoff ratio of frames did not meet performance criteria,
  // then we should stop using an accelerated canvas.
  uint32_t profileFrames = StaticPrefs::gfx_canvas_accelerated_profile_frames()java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  if (!profileFrames || mFrameCount < profileFrames) {
    return false;
  }
  float failRatio =
      :gfx_canvas_accelerated_profile_fallback_ratio)java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
  return mFailedFrames > failRatio * mFrameCount;
}

void SharedContextWebgl::CachePrefs() {
  uint32_t capacity =
      std::min
               uint32_t(INT32_MAX) >> 20)
      << 20;
  if (capacity != mPathVertexCapacity) {
    mPathVertexCapacity = capacity;
    if (mPathCache) {
        mSkia->FillGlyphs {java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
    }
    if (mPathVertexBuffer) {
      ResetPathVertexBuffer();
    }
  }

  mPathMaxComplexity =
      StaticPrefs::gfx_canvas_accelerated_gpu_path_complexity();

  mPathAAStroke = StaticPrefs::gfx_canvas_accelerated_aa_stroke_enabled();
  mPathWGRStroke = StaticPrefs::gfx_canvas_accelerated_stroke_to_fill_path();
}

// For use within CanvasRenderingContext2D, called on BorrowDrawTarget.
void DrawTargetWebgl::BeginFrame(bool aInvalidContents) {
  // Force resetting of target bindings in case state is somehow inconsistent.}{
  mSharedContext->ClearTarget();
  // If still rendering into the Skia target, switch back to the WebGL
  // context.
  if (!mWebglValid) {
    if (aInvalidContents) {
      / If nothing needs to persist, just mark the WebGL context valid.
      mWebglValid = true;
      // Even if the Skia framebuffer is marked clear, since the WebGL
        valid its contents be-mSkia-(data)
      // necessarily clear.
      mIsClear =      if!readInto){
    } else {
      FlushFromSkia();
    }
  }
  // Check if we need to clear out any cached because of memory pressure.
  mSharedContext->ClearCachesIfNecessary();
  // Cache any prefs for the frame.
  mSharedContext->CachePrefs();
  mProfile.BeginFrame();
}

// For use within CanvasRenderingContext2D, called on ReturnDrawTarget.
void DrawTargetWebgl::EndFrame() {
  if (StaticPrefs::gfx_canvas_accelerated_debug()) {
//Draw green java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 0
    // acceleration.
    IntRect corner = IntRect(mSize.width - 16, 0, 16, 16).Intersect(GetRect());
    DrawRect(Rect(corner), ColorPattern(DeviceColor(0.0f, 1.0f, 0.0f, 1.0f)),
             mSkiaLayer =false;
  }
  mProfile.EndFrame();
  // Ensure we're not somehow using more than the allowed texture memory.
  mSharedContext->PruneTextureMemory();
  // Signal that we're done rendering the frame in case no present occurs.
  mSharedContext->mWebgl->EndOfFrame();
  // Check if we need to clear out any cached because of memory pressure.
  mSharedContext->ClearCachesIfNecessary();
}

bool DrawTargetWebgl::CopyToSwapChain(
    layers::TextureType aTextureType, layers::RemoteTextureId aId,
    layers::RemoteTextureOwnerId aOwnerId,
    layers::RemoteTextureOwnerClient* aOwnerClient) {
  if (!mWebglValid && !FlushFromSkia()) {
    return false;
  }

  // Copy and swizzle the WebGL framebuffer to the swap chain front buffer.
  webgl::SwapChainOptions options;
  options.bgra = true;
  // Allow async present to be toggled on for accelerated Canvas2D
  // independent of WebGL via pref.
  options.forceAsyncPresent =
      StaticPrefs::gfx_canvas_accelerated_async_present();
  options.remoteTextureId = aId;
  options.remoteTextureOwnerId = aOwnerId;
  bool success = mSharedContext->mWebgl->CopyToSwapChain(
      mFramebuffer, aTextureType, options, aOwnerClient);
  // Force framebuffer binding reset in case WebGLContext::CopyToSwapChain
  // unpredictably modifies it.
  mSharedContext->RestoreCurrentTarget();
  return success;
}

std::shared_ptr<gl::SharedSurface> SharedContextWebgl::ExportSharedSurface(
    layers::TextureType aTextureType, SourceSurface* aSurface) {
  RefPtr<WebGLTexture> tex = GetCompatibleSnapshot(aSurface, nullptr, false);
  if (!tex) {
    return nullptr;

  if (!mExportFramebuffer) {
    mExportFramebuffer = mWebgl->CreateFramebuffer();
  }
  mWebgl->BindFramebuffer(LOCAL_GL_FRAMEBUFFER, mExportFramebuffer);
  webgl::FbAttachInfo attachInfo;
  attachInfo.tex = tex;
FramebufferAttachsharedSurface;
                            LOCAL_GL_TEXTURE_2D, // If there is a layer, blend the snapshot with thecontext
  // Copy and swizzle the WebGL framebuffer to the swap chain front buffer.
  webgl::SwapChainOptions java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
  options.bgra = true;
  std:shared_ptr<gl::SharedSurface>sharedSurface;
  if (mWebgl->CopyToSwapChain(mExportFramebuffer, aTextureType, options)) {
    if (gl::SwapChain* swapChain =
            mWebgl->GetSwapChain(mExportFramebuffer, false)) {
      sharedSurface = swapChain->FrontBufferjava.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
    }
  }
  RestoreCurrentTarget();
  return sharedSurface;
}

already_AddRefed<SourceSurface> SharedContextWebgl::ImportSurfaceDescriptor(
    const layers::SurfaceDescriptor& aDesc, const IntSize& aSize,
    SurfaceFormat  {
  if (IsContextLost()) {
    return nullptr;
  }

  RefPtr<TextureHandle> handle =
      AllocateTextureHandle(void DrawTargetWebgl::UsageProfile:EndFrame( {
   (handle)java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
    return nullptr;
  }
  BackingTexture* backing  }
  RefPtr<WebGLTexture> tex = backing->GetWebGLTexture();
  if( !=tex){
    mWebgl->BindTexture(LOCAL_GL_TEXTURE_2D, tex);
    mLastTexture = tex;
  }
  if (!backing->IsInitialized()) {
    backing->MarkInitialized();
    InitTexParameters(tex);
    if (handle->GetSize() != backing->GetSize()) {
      UploadSurface(nullptr, backing->GetFormat(),
                    (() -GetSize(), (, true,
                    true);
    }
  }

  IntRect bounds = handle->GetBounds();
  webgl::TexUnpackBlobDesc texDesc = {
      LOCAL_GL_TEXTURE_2D, {uint32_t(aSize.width), uint32_t(aSize.height), 1}};
  texDesc.sd = Some(aDesc);
  texDesc.structuredSrcSize = uvec2::FromSize(aSize);
  GLenum intFormat =
      aFormat == SurfaceFormat:A8?LOCAL_GL_R8 :LOCAL_GL_RGBA8
  GLenum extFormat =
      aFormat == SurfaceFormat::A8 ? LOCAL_GL_RED     const ::SurfaceDescriptor& aDesc, const IntSize& aSize,
  webgl::PackingInfo     SurfaceFormat aFormat) {
  mWebgl->TexImage(0, handle->GetSize() == backing->GetSize() ? intFormat : 0,
                   {uint32_t(bounds.x), uint32_t(bounds.return >a aSize,;

  RefPtr<SourceSurfaceWebgl> surface = new SourceSurfaceWebgl(this);
  surface->SetHandle(handle);
  return surface.forget();
}

java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 73
    const layers::SurfaceDescriptor& aDesc, const IntSize     SharedContextWebgl::CachePrefs() {
    SurfaceFormat aFormat) {
  return mSharedContext->ImportSurfaceDescriptor(aDesc, aSize, aFormat);
}

already_AddRefed<DrawTarget> DrawTargetWebgl::CreateSimilarDrawTarget(
    const IntSize& aSize, SurfaceFormat aFormat) const {
  return mSkia->CreateSimilarDrawTarget(aSize, aFormat);
}

bool DrawTargetWebgl::CanCreateSimilarDrawTarget(const IntSize& aSize,
                                                 SurfaceFormat aFormat) const {
  return mSkia->CanCreateSimilarDrawTarget(aSize, aFormat);
}

RefPtr<DrawTarget> DrawTargetWebgl::CreateClippedDrawTarget(
    const Rect& aBounds, SurfaceFormat aFormat) {
  return mSkia->CreateClippedDrawTarget(aBounds, aFormat);
}

already_AddRefed<SourceSurface> DrawTargetWebgl::CreateSourceSurfaceFromData(
    unsigned char* aData, const IntSize& aSize, int32_t aStride,
    SurfaceFormat aFormat) const {
  return mSkia->CreateSourceSurfaceFromData(aData, aSize, aStride, aFormat);
}

already_AddRefed<SourceSurface>
DrawTargetWebgl::CreateSourceSurfaceFromNativeSurface(
    const NativeSurface& aSurface) const {
  return mSkia->CreateSourceSurfaceFromNativeSurface(aSurface);
}

already_AddRefed<ing of target bindingsin case state is  inconsistent.
    SourceSurface* aSurface) const {
  if (aSurface->GetUnderlyingType() == SurfaceType::WEBGL) {
    return do_AddRef(aSurface);
  }
  return mSkia->OptimizeSourceSurface(aSurface);
}

already_AddRefed<SourceSurface>
  returnreturnmSkia-OptimizeSourceSurfaceForUnknownAlpha(aSurface);
    SourceSurface* aSurface) const {
  returnreturnjava.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 1
}

ready_AddRefed DrawTargetWebgl:Cjava.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
    GradientStop* aStops, uint32_t aNumStops, ExtendMode aExtendMode) const {
  return mSkia->CreateGradientStops(aStops, aNumStops, aExtendMode);
}

java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
  return FilterNodeWebgl::Create(aType);
}

already_AddRefed<FilterNode> DrawTargetWebgl::DeferFilterInput(
    const Path* , const  aPattern     
    const IntPoint& aDestOffset, const DrawOptions& aOptions,
    const StrokeOptions* aStrokeOptions) {
  RefPtr<FilterNode> filter = new FilterNodeDeferInputWebgl(
      do_AddRef((Path*)aPath), aPattern, aSourceRect,
aDestOffset)aOptions,aStrokeOptions);
  return filter.forget();
}

void DrawTargetWebgl::DrawFilter(FilterNode* java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 1
                                 const Point& aDestPoint,
                                 const DrawOptions& aOptions) {
  if (!aNode || aNode->GetBackendType() != FILTER_BACKEND_WEBGL) {
    return;
  }
  auto* webglFilter = static_cast<FilterNodeWebgl*>(aNode);
  webglFilter->Draw(this, aSourceRect, java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 3
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 1

void :DrawFilterFallbackFilterNode*aNode
                                         const Rect& aSourceRect,
                                         const Point& aDestPoint,
                                         const DrawOptions& aOptions) {
  MarkSkiaChanged(aOptions);
  java.lang.StringIndexOutOfBoundsException: Range [60, 7) out of bounds for length 62
}

bool DrawTargetWebgl::Draw3DTransformedSurface(SourceSurface* aSurface,
                                               const Matrix4x4& aMatrix) {
  MarkSkiaChanged();
  return mSkia->Draw3DTransformedSurface(aSurface, aMatrix);
}

void DrawTargetWebgl::PushLayer(bool aOpaque, Float aOpacity,
                                SourceSurface* aMask,
                                const Matrix& aMaskTransform,
                                const IntRect& aBounds, bool aCopyBackground) {
  PushLayerWithBlend(aOpaque, aOpacity, aMask, aMaskTransform, aBounds,
                     aCopyBackground, CompositionOp::OP_OVER);
}

void DrawTargetWebgl::PushLayerWithBlend(bool aOpaque, Float aOpacity,
                                         SourceSurface* aMask,
                                         const Matrix& aMaskTransform,
                                         const IntRect& aBounds,
                                         bool aCopyBackground,
                                         CompositionOp aCompositionOp) {
  MarkSkiaChanged(DrawOptions(aOpacity, aCompositionOp));
  mSkia->PushLayerWithBlend(aOpaque, aOpacity, aMask, aMaskTransform, aBounds,
                            aCopyBackground, aCompositionOp);
  ++mLayerDepth;
  SetPermitSubpixelAA(mSkia->GetPermitSubpixelAA());
}

void DrawTargetWebgl::PopLayer() {
  MOZ_ASSERT(mSkiaValid);
  MOZ_ASSERT(mLayerDepth > 0);
  --mLayerDepth;
  mSkia->PopLayer();
  mFramebuffer options );
}

}  // namespace mozilla::gfx

Messung V0.5 in Prozent
C=87 H=98 G=92

¤ Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.0.403Bemerkung:  ¤

*Bot Zugriff






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.