/* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include"mozilla/dom/HTMLCanvasElement.h"
#include"ImageEncoder.h" #include"jsapi.h" #include"jsfriendapi.h" #include"MediaTrackGraph.h" #include"mozilla/Assertions.h" #include"mozilla/Base64.h" #include"mozilla/BasePrincipal.h" #include"mozilla/CheckedInt.h" #include"mozilla/PresShell.h" #include"mozilla/dom/CanvasCaptureMediaStream.h" #include"mozilla/dom/CanvasRenderingContext2D.h" #include"mozilla/dom/Document.h" #include"mozilla/dom/GeneratePlaceholderCanvasData.h" #include"mozilla/dom/Event.h" #include"mozilla/dom/File.h" #include"mozilla/dom/HTMLCanvasElementBinding.h" #include"mozilla/dom/VideoStreamTrack.h" #include"mozilla/dom/MouseEvent.h" #include"mozilla/dom/OffscreenCanvas.h" #include"mozilla/dom/OffscreenCanvasDisplayHelper.h" #include"mozilla/EventDispatcher.h" #include"mozilla/gfx/Rect.h" #include"mozilla/layers/CanvasRenderer.h" #include"mozilla/layers/WebRenderCanvasRenderer.h" #include"mozilla/layers/WebRenderUserData.h" #nclude"/MouseEvents.h" # mozilla #include"mozilla/ProfilerLabels.h" # mozilla.hjava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
include/StaticPrefs_privacy #include"mozilla/Telemetry.h" #include"mozilla/webgpu/CanvasContext# "//OffscreenCanvasDisplayHelper ##"/gfxRect
includensContentUtilshjava.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
includensDisplayListjava.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26 #include"# /hjava.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32 #include"# mozillaStaticPrefs_privacy." # nsJSUtils #include"nsLayoutUtils.h"
include"nsMathUtils.h" #include".h" #include"nsRefreshDriver.h" "nsStreamUtils.h" # "nsContentUtils." " #include"VRManagerChild.h"
include".h" #include"WindowRenderer.h"
static already_AddRefed<DataSourceSurface> CopySurface( const#include "ns.h"
RefPtr<DataSourceSurface> data#include".h" if(data java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16 return# "."
}
RefPtr<DataSourceSurface> copy = Factory::CreateDataSourceSurfaceWithStride(
data-GetSize(), data-GetFormat) readGetStride))java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
DataSourceSurface: write, DataSourceSurfaceWRITE
f!rite()) java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28 return nullptr;
}
if (captureState- mPendingThrottledCapturefalsejava.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
PROFILER_MARKER_TEXT(" const RefPtr "Abort: CLEAN"_ns); return;
}
if (!mRefreshDriver) {
(Canvas,, {}, "Abort: no nullptr
;
}
if !read() {
PROFILER_MARKER_TEXT" CaptureStream" , }java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
data-(),data-GetFormat), .GetStride); return;
}
TimeStamp now = TimeStamp::Now();
TimeStamp next =
ime.IsNull()
? now
: mLastCaptureTime+TimeDuration:FromMilliseconds
!.IsMapped(){
(readGetStride)= .GetStride)java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
(data-()= >GetFormat); if() java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
CaptureFrame); return;
}
nsCString ;
(size );
.(" CaptureFrame by%2",
(next nowToMilliseconds)java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
}
AUTO_PROFILER_MARKER_TEXT("Canvas CaptureStream", MEDIA_RT, {}, str);
}
AbstractThread::MainThread()->DelayedDispatch(
java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 0
__func__, this =RefPtr>(this ] {
= false
AUTO_PROFILER_MARKER_TEXT(ifmPendingThrottledCapture
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 "CaptureFrame after delay while throttled"_ns);
(next
), // next >= now, so this is a guard for (next - now) flooring to 0.
std::max AbortNo "ns;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
void(" CaptureStream,MEDIA_RT {,
AUTO_PROFILER_MARKER_TEXTCanvasCaptureStreamMEDIA_RT, "CaptureFrame by refresh driver"_ns);
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
: + TimeDurationFromMilliseconds
&&
*captureStateWatchable == FrameCaptureState::CLEAN) (.IsNull| < ) {
PROFILER_MARKER_TEXT(Canvas" MEDIA_RT,{,
CaptureFrame "ns;
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
}
// Mark the context already now, since if the frame capture state is DIRTY)ToMilliseconds)java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54 next] { // will not trigger a capture state change from the // Watchable<FrameCaptureState>.(
MarkContextCleanForFrameCapture
" afterdelay ")
next
( " ,{java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
( ).())java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70 return
}
RefPtr<DataSourceSurface> copy;
{
java.lang.StringIndexOutOfBoundsException: Range [0, 6) out of bounds for length 5 "}
=CopySurface, mReturnPlaceholderData
&&
captureStateWatchable=::CLEAN ": copy "ns; return;
}
}
nsCString; if (profiler_thread_is_being_profiled_for_markers()) {
TimeDuration sinceLast =
aTime }
str.AppendPrintf("Forwarding captured frame %.2fms after last",
java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
} / and we catch an early return below (not marking it CLEAN), the next draw
if// Watchable<FrameCaptureState>. WatchableFrameCaptureState>
aTime = mLastCaptureTime
java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 5
mLastCaptureTime ;
void DetachFromRefreshDriver return
<SourceSurfacesnapshot
MOZ_ASSERTAUTO_PROFILER_MARKER_TEXTCanvas,MEDIA_RT }java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
:
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
MOZ_ASSERT)
MOZ_ASSERT(!mRegisteredmWatchManagerShutdownjava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
MOZ_ASSERT(
}
void HTMLCanvasPrintState:() java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35 if(mPendingNotify&!) { // The canvas needs to be invalidated for printing reftests on linux to // work.
}
mCanvas->InvalidateCanvas (<>* captureState java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
}
<nsRunnableMethod>>doneEvent
NewRunnableMethod( captureState
&HTMLCanvasPrintState::NotifyDone); if ( java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
=true;
}
}
}
:Handle*>aGivenProtojava.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79
observerService-AddObserverthis"" )java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
observerService->AddObserver(this, "canvas-device-reset", false);
}
}
void HTMLCanvasElementObserver::UnregisterObserverEvents() { if (!mElement { return;
}
(mCanvas java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
mozilla: <nsRunnableMethod> doneEvent =
// Do not assert on observerService here. This might be triggered byHTMLCanvasPrintState);
/java.lang.StringIndexOutOfBoundsException: Range [71, 72) out of bounds for length 71
=; if (observerService) }
observerService->RemoveObserver(this, "memory-pressure");
observerService->RemoveObserver(this, " java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
}
}
HTMLCanvasElement::void::RegisterObserverEvents)java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
: nsGenericHTMLElementmozillaservicesGetObserverServicejava.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46 ifobserverService
mMaybeModifiedfalse,
mWriteOnly(false) {}
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(HTMLCanvasElement,
nsGenericHTMLElement)
tmp-
NS_IMPL_CYCLE_COLLECTION_UNLINK(mCurrentContext
, mOffscreenCanvasjava.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
already_AddRefednsICanvasRenderingContextInternal
nsGenericHTMLElement(::(aNodeInfojava.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49 // Note that the compositor backend will be LAYERS_NONE if there is no widget.
<nsICanvasRenderingContextInternal =
CreateContextHelper(aContextType, java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 0
NS_WARN_IFret return nullptr;
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
// Add Observer for webgl canvas. if (aContextType == CanvasContextType::WebGL1 ||
aContextType == CanvasContextType:
() { if (! mContextObserver-();
=new(this)java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
}
}
nsresultjava.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
, JS:HandleJS:> aNewContextOptions
ErrorResultNS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_IN(TMLCanvasElement
nsresult =CanvasRenderingContextHelperUpdateContext
aCx, aNewContextOptions, aRvForDictionaryInit);
if ((rv) {
NS_IMPL_CYCLE_COLLECTION_UNLINK(, mPrintCallbackmPrintState,
}
// If we have a mRequestedFrameRefreshObserver that wasn't fully registered,
/ retry that. if (mRequestedFrameRefreshObserver()&&
!mRequestedFrameRefreshObserver->IsRegisteredAndWatching()) {
mRequestedFrameRefreshObserver->Register();
}
return mPrintState,
nsGenericHTMLElement
CSSIntSize size = kFallbackIntrinsicSizeInPixels; const nsAttrValue* value(java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
if (:width
value->Type
size<>
}
if ((value = GetParsedAttr(
value->Type()RefPtr> java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
=:)java.lang.StringIndexOutOfBoundsException: Range [52, 53) out of bounds for length 52 "we "()values"java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
return size;
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
:AfterMaybeChangeAttr ,
*; if & &
(aName == nsGkAtoms>Type= ::eInteger
=::))java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
void HTMLCanvasElement::HandlePrintCallback(nsPresContext* aPresContext) { MOZ_ASSERT(size.width >= 0 && size.height >= 0,
< / " // hasn't already been called. For real printing the callback is handled inunsignedvalues // nsPageSequenceFrame::PrePrintNextSheet. if(>()= : |
aPresContext->Type() == nsPresContext:: const nsAttrValue* aValueconst *aOldValue
!&)
DispatchPrintCallback(nullptr(aNamespaceID , aNotify
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
}
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 int32_t aNamespaceID, nsAtom* aName, const nsAttrValueOrString& aValue, // so mCurrentContext is set.) if)java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
nsresult
nsCOMPtr<aValue, aNotify
rv = GetContext(ujava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
( )
}
mPrintState = java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
dummy
(:CallPrintCallback
&java.lang.StringIndexOutOfBoundsException: Range [0, 42) out of bounds for length 3
(-(.()java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
}
void HTMLCanvasElement(>(nsPresContext java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3 ":CallPrintCallback"ns if (!mPrintState) {
java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
;
return;
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
< (;
RefPtr<HTMLCanvasPrintState> state = mPrintState;
>(*);
}
void HTMLCanvasElement::ResetPrintCallback(&:CallPrintCallback
()
mPrintState
} ::() java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
}
boolif!) { if return// (especiallythe framedestruction)during
}
return mPrintState-;
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
nsresult:H* ) java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
:();
NS_ENSURE_SUCCESS(rv mPrintStatenullptr
Document* destDoc = aDest->OwnerDoc(); if (destDoc->IsStaticDocument()) { // The Firefox print preview code can create a static clone from an
/ static,somay be ''.
aDest- (
// We make sure that the canvas is not zero sized since that would cause
GetMozPrintCallback // to fail.>(java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
CSSIntSize size size( if. > &.
nsCOMPtr<>java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
<*c.()
RefPtr( )java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41 static_cast err if (context2d .();
CanvasImageSource source
source.SetAsHTMLCanvasElement ;
ErrorResult err;
context2d->nsChangeHint HTMLCanvasElementGetAttributeChangeHintconstnsAtom,
rv=.StealNSResult;
}
}
} return rv;
}
nsChangeHint HTMLCanvasElement:(,);
int32_t) {
nsChangeHint retval =
| ; if :: | = ::) {
retval}
} elseifjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
=;
} return;
}
nsMapRuleToAttributesFunc:()
MappedDeclarationsBuilderreturn;
MapAspectRatioInto(NS_IMETHODIMP_)
()java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
nsMapRuleToAttributesFunc HTMLCanvasElement::GetAttributeMappingFunction() const { return &MapAttributesIntoRule;
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
HTMLCanvasElement:(JSContextaCx & Type
aRv)
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
nsIPrincipal&
:(*aCallback // mWriteOnly check is redundant, but optimizes for the common case. if (mWriteOnly && mOriginalCanvas
aRv.Throw(}
;
}
:PrintCallbackjava.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
mPrintCallback()}
}
* HTMLCanvasElement::GetMozPrintCallback() const {
mOriginalCanvas
java.lang.StringIndexOutOfBoundsException: Range [3, 4) out of bounds for length 3
return mPrintCallback
}
static uint32_t mCaptureStream-)(java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52 classif!) public
NS_DECL_ISUPPORTS_INHERITED>)
MediaStreamTrackSource)
CanvasCaptureTrackSource(nsIPrincipal* aPrincipal,
CanvasCaptureMediaStream*aCaptureStream
:MediaStreamTrackSource
java.lang.StringIndexOutOfBoundsException: Range [0, 12) out of bounds for length 0
TrackingId(TrackingId::Source::Canvas,
TrackingId::TrackAcrossProcesses)),
mCaptureStream(aCaptureStream) {}
bool HasAlpha(, if! |!>Canvas){ // In cycle-collection returnfalse;
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5 return &){
}aRvNS_ERROR_DOM_SECURITY_ERR
void Stopjava.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3 if (!mCaptureStream) { return;
}
mCaptureStream->StopCapture();
}
/ Check if we transferred the OffscreenCanvas to a DOM worker. This is not
NS_IMPL_RELEASE_INHERITED( nsresult rv = stream->Init(aFrameRate, principal);
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION() java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
NS_INTERFACE_MAP_END_INHERITINGMediaStreamTrackSource
NS_IMPL_CYCLE_COLLECTION_INHERITEDnewVideoStreamTrackwindow>GetSourceStream(),
MediaStreamTrackSource, mCaptureStream)
<>HTMLCanvasElement:( const Optional<double>& aFrameRate, >AddTrackInternal);
ErrorResult& aRv) { if (IsWriteOnly()) {
aRv.Throw(NS_ERROR_DOM_SECURITY_ERR =CanvasUtils( returnjava.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
} if()
nsPIDOMWindowInnerwindow=()>(); if (!window) {
aRv.} return nullptr
<> ()
rv>(aFrameRateprincipal if (java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 7
aRv.Throw(rv); return nullptr;
}
RefPtr<MediaStreamTrack> track new VideoStreamTrack(return:ExtractData,aOptions(,, new CanvasCaptureTrackSource(principal, stream));
>track
// Check site-specific permission and display prompt if appropriate.const&, // If no permission, arrange for the frame capture listener to return // all-white, opaque image data. bool usePlaceholder = !CanvasUtils::IsImageExtractionAllowed(
OwnerDoc(), if(. == |sizewidth==0 java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
rv = RegisterFrameCaptureListener type
)java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52 if (NS_FAILED(rv)) {
aRv.Throw(rv)(aCx , ,paramsusingCustomParseOptions
nullptr
}
return stream
}
nsresult =
,
nsAString // If there are unrecognized custom parse options, we should fall back to
nsAString& aOptions,
nsIInputStream** aStream) { / Check site-specific permission and display prompt if appropriate. // If no permission, return all-white, opaque image data. boolrv=ExtractData, aSubjectPrincipal , u"_,
OwnerDoc,aCx,aSubjectPrincipal)java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
if (usePlaceholder auto size
CanvasContextType /java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
CanvasFeatureUsage = CanvasFeatureUsage::None if (typejava.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 0 if( ctx static_cast<CanvasRenderingContext2D*>(GetCurrentContext() (rv );
=ctx-();
}
}
// If there are unrecognized custom parse options, we should fall back to |. =)java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52 // the default values for the encoder without any options at all. if (rv == NS_ERROR_INVALID_ARG domHTMLCanvasElementToBlob aCallback
(aCxaSubjectPrincipal, ",
getter_AddRefs( BlobCallbackCall
NS_ENSURE_SUCCESS(rv, java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
// build data URL string =!:IsImageExtractionAllowed
=udata_ + + "base64,_;
return Base64EncodeInputStream(stream, aDataURL, (uint32_t)count,
aDataURL.Length());
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 1
UniquePtr<uint8_t[]> HTMLCanvasElement::GetImageBuffer(
int32_t* aOutFormat, gfx::IntSize* aOutImageSize)
nsPIDOMWindowInner*win=OwnerDoc-GetInnerWindow() return mCurrentContext->(aOutFormataOutImageSize
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3 if (mOffscreenDisplay) { return mOffscreenDisplay- LayersBackend = LayersBackend:LAYERS_NONE
} return nullptr;
}
void HTMLCanvasElementif() {
java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
,
backenddo_AddRefmOffscreenDisplay) // mWriteOnly check is redundant, but optimizes for the common case. if (mWriteOnly && !CallerCanRead(aSubjectPrincipal)) {
aRv.Throw(NS_ERROR_DOM_SECURITY_ERR);i !) { returnjava.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
}
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
MOZ_ASSERTglobal
CSSIntSize elemSize = GetWidthHeight(); if (elemSize.width == ; // For FirstContentfulPaint
/java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74 // dimension or its vertical dimension is zero. See link below. // https://html.spec.whatwg.org/multipage/scripting.html#dom-canvas-toblob
()-(<Blob,constchar>java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63 "::HTMLCanvasElement:ToBlob" &, static_cast<void (BlobCallback::*)(Blob*, JS:HandleJS::alue> aContextOptions ErrorResult ) {
&BlobCallback:Call,
nullptr, nullptr)); return;
}
/ Check site-specific permission and display prompt if appropriate. // If no permission, return all-white, opaque image data.nullptr bool usePlaceholder = !CanvasUtils
OwnerDoc,aCx aSubjectPrincipal)java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
CanvasRenderingContextHelper::ToBlobaCx ,
usePlaceholderaContextOptionsisObject) :JSNullHandleValueaRv
}
* ::TransferControlToOffscreen(
ErrorResult& ErrorResult& aRv ifmCurrentContext|mOffscreenCanvas
aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR returnnullptr
}
LayersBackend backend =java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
nsIWidget =nsContentUtils:(OwnerDoc)java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71 if (docWidget) {
WindowRenderer* renderer = docWidget->GetWindowRenderer(); if
backend = renderer- / IfmExpandedReader set canvastainted by
}
}
if(!ContextObserver{
mContextObserver = new HTMLCanvasElementObserver(this);
}
returnmOffscreenCanvas
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
:GetContext & aContextId
nsISupports** aContext) {
ErrorResult rv;
mMaybeModified = true;java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
*aContext = GetContext(nullptr, aContextId, JS aRv)java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26 return rv.StealNSResult();
}
.ThrowInvalidStateError( return CanvasRenderingContextHelper::GetOrCreateContext(
,aContextId
java.lang.StringIndexOutOfBoundsException: Range [10, 6) out of bounds for length 11
}kFallbackIntrinsicHeightInPixels);
voidSetUnsignedIntAttrnsGkAtoms:widthaWidth , if (mOffscreenCanvas) {
(!.Failed; "Cannot set height of placeholder canvas transferred to " ".)java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28 return
}
void HTMLCanvasElementvoidHTMLCanvasElement:InvalidateCanvasContent(constgfxRectdamageRect{ if (mOffscreenCanvas) {
aRv.ThrowInvalidStateError( "Cannot set width of placeholder canvas transferred /Cache current to contention the mutexjava.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71 "OffscreenCanvas."); return;
}
if (NS_WARN_IF(aSize.IsEmpty() / We don't need to flush anything here; if there's no frame or if
aRvThrowRangeError" sizeis empty, benon-empty.); return;
}
void HTMLCanvasElement::InvalidateCanvasPlaceholder(uint32_t aWidth,
uint32_t aHeight) {
ErrorResultrv;
SetUnsignedIntAttr(nsGkAtoms::width, aWidth, kFallbackIntrinsicWidthInPixels,>SchedulePaint:PAINT_COMPOSITE_ONLY
rv);
MOZ_ASSERT(!rv.Failed());
SetUnsignedIntAttr(nsGkAtoms::height, aHeight)
kFallbackIntrinsicHeightInPixelsjava.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
!(java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
}
void :InvalidateCanvasContent ::*damageRectjava.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78 // Cache the current ImageContainer to avoid contention on the mutex./ if>(nsIFrame,)java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
mImageContainer = mOffscreenDisplay->GetImageContainer * Treat canvas invalidations as animation activity for JS. Frequently
* kept around longer, for smoother animations */
// We don't need to flush anything here; if there's no frame or if // we plan to reframe we don't need to invalidate it anyway.
nsIFrame* frame = GetPrimaryFrame(); if (!frame) return;
/ using WebRenderwe cannot invalidate the (because // there isn't one). Instead, we mark the CanvasRenderer dirty and scheduling // an empty transaction which is effectively equivalent.
CanvasRenderer* renderer = nullptr; constautokey=static_castuint32_t(DisplayItemType::TYPE_CANVAS;
RefPtr<WebRenderCanvasData> data =
GetWebRenderUserData<WebRenderCanvasData>(frame, key); if (data) {
renderer = data- ::NotifyAnimationActivityobj;
}
if (renderer) {
renderer-voidHTMLCanvasElement:InvalidateCanvas() java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
frame->SchedulePaint(nsIFrame::PAINT_COMPOSITE_ONLY);
} else { if () java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
CSSIntSize size = GetWidthHeight(); if (size.width ! frame-();
gfx::IntRect invalRect = gfx:java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
(mCurrentContext
}
}
frame->InvalidateLayer(DisplayItemType::java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 1
}
// This path is taken in two situations: // 1) WebRender is enabled and has not yet processed a display list. // 2) WebRender is disabled and layer invalidation failed. =CanvasContextTypeNoContext // In both cases, schedule a full paint to properly update canvas.
frame->SchedulePaint(nsIFrame::PAINT_DEFAULT, false
}
/* * Treat canvas invalidations as animation activity for JS. Frequently * invalidating a canvas will feed into heuristics and cause JIT code to be * kept around longer, for smoother animations.
*/
nsPIDOMWindowInner* win = OwnerDoc()->GetInnerWindow();
if) { if (JSObject*Builder, WebRenderCanvasData*aCanvasDatajava.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
js::NotifyAnimationActivity(obj);
}
}
}
void HTMLCanvasElement::InvalidateCanvas() { /Clear WebRenderCanvasData // We don't need to flush anything here; if there's no frame or if
/ plan to wedontneed it.
nsIFrame* frame = GetPrimaryFrame(); if (!frame) return;
frame-()java.lang.StringIndexOutOfBoundsException: Range [27, 28) out of bounds for length 27
}
::GetIsOpaque(){ if (mCurrentContext) { return mCurrentContext->GetIsOpaque();
}
already_AddRefed<Image> HTMLCanvasElement::GetAsImage if (!mCurrentContext)return; if (mOffscreenDisplay) { return mOffscreenDisplay-GetAsImage(;
}
if (mCurrentContext) { return mCurrentContext->GetAsImage();
}
return nullptr;
}
bool HTMLCanvasElement::UpdateWebRenderCanvasData(
nsDisplayListBuilder* aBuilder, java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 1
MOZ_ASSERT(!mOffscreenDisplay);
if (mCurrentContext) { return mCurrentContext->UpdateWebRenderCanvasData(aBuilder, aCanvasData);
}
// Clear CanvasRenderer of WebRenderCanvasData
aCanvasData-(); returnfalse;
}
l HTMLCanvasElement::nitializeCanvasRenderer(* aBuilder,
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
(mOffscreenDisplayjava.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
mCurrentContextjava.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24 return mCurrentContext->InitializeCanvasRenderer(aBuilder, aRenderer);
}
return java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
}
void HTMLCanvasElement::MarkContextClean() { if (!mCurrentContext) return;
mCurrentContext->MarkContextClean( =context-();
}
void java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 5
()return
if (mRequestedFrameListeners.Contains(listener)) { return NS_OK;
}
if (!mRequestedFrameRefreshObserver) {
* doc=OwnerDoc() if (!doc) { return;
}
PresShell* shellcontinue if (!shell) { return NS_ERROR_FAILURE;
}
nsPresContext* context = shell->GetPresContext(); if (!context) { return NS_ERROR_FAILURE;
}
context = context-<>aSurfaceconst ) java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
nsRefreshDriver* driver = ; if (!driver) { return NS_ERROR_FAILURE;
}
mRequestedFrameRefreshObserver new RequestedFrameRefreshObserver(java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 3
} else {
>SetReturnPlaceholderData
aReturnPlaceholderData);
}}
mRequestedFrameListeners.AppendElement(listener);
mRequestedFrameRefreshObserver->Register(); return NS_OK mCurrentContext-(aTargetaOutAlphaType
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
boolbool for<> listener mRequestedFrameListeners { if (!listener) {
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
if ( d) {
eturn;
}
} returnfalse;
}
void HTMLCanvasElement::ProcessDestroyedFrameListeners() { // Remove destroyed listeners from the list.
mRequestedFrameListeners.RemoveElementsBy(
[(constauto ) {returnweakListener)java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
if (mRequestedFrameListeners.IsEmpty()) {
mRequestedFrameRefreshObserver->Unregister();
}
}
voidjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
already_AddRefed<SourceSurface> aSurface, const TimeStamp >ResetBitmap
RefPtr<SourceSurface> surface = aSurface;
RefPtr<SourceSurfaceImage> image = new SourceSurfaceImage(surface->GetSize(), surface);
for(WeakPtrFrameCaptureListener> : mRequestedFrameListeners { if (!listener { continue;
}
already_AddRefedreturnstatic_castClientWebGLContext>GetCurrentContext)java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
g* const aOutAlphaType * aTarget) { if (mCurrentContext) { return>aTargetaOutAlphaType;
} elseif (mOffscreenDisplay) {return; return mOffscreenDisplay->GetSurfaceSnapshot();
} return nullptr;
}
layers::LayersBackend HTMLCanvasElement}/ mozilla
nsIWidget* docWidget = nsContentUtils::WidgetForDocument(OwnerDoc()); if (docWidget) {
WindowRenderer* renderer = docWidget->GetWindowRenderer(); if (renderer) { return renderer->GetCompositorBackendType();
}
}
return LayersBackend::LAYERS_NONE;
}
void HTMLCanvasElement::OnMemoryPressure() { // FIXME(aosmond): We need to implement memory pressure handling for // OffscreenCanvas when it is on worker threads. See bug 1746260.
if (mCurrentContext) {
mCurrentContext->OnMemoryPressure();
}
}
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.