This commit is contained in:
Wes Kocher 2013-12-20 18:42:04 -08:00
Родитель dd72dd2a82 1bdeb67c5f
Коммит 53c4b1ac6a
232 изменённых файлов: 2770 добавлений и 1155 удалений

Просмотреть файл

@ -1803,8 +1803,9 @@ DocAccessible::UpdateTree(Accessible* aContainer, nsIContent* aChildNode,
Accessible* child = aContainer->ContentChildAt(idx);
// If accessible doesn't have its own content then we assume parent
// will handle its update.
if (!child->HasOwnContent()) {
// will handle its update. If child is DocAccessible then we don't
// handle updating it here either.
if (!child->HasOwnContent() || child->IsDoc()) {
idx++;
continue;
}

Просмотреть файл

@ -163,9 +163,14 @@ function forwardToChild(aMessage, aListener, aVCPosition) {
function activateCurrent(aMessage) {
Logger.debug('activateCurrent');
function activateAccessible(aAccessible) {
if (aMessage.json.activateIfKey &&
aAccessible.role != Roles.KEY) {
// Only activate keys, don't do anything on other objects.
try {
if (aMessage.json.activateIfKey &&
aAccessible.role != Roles.KEY) {
// Only activate keys, don't do anything on other objects.
return;
}
} catch (e) {
// accessible is invalid. Silently fail.
return;
}

Просмотреть файл

@ -3,6 +3,7 @@
[test_ariadialog.html]
[test_bug852150.xhtml]
[test_bug883708.xhtml]
[test_bug884251.xhtml]
[test_bug895082.html]
[test_canvas.html]
[test_colorpicker.xul]

Просмотреть файл

@ -0,0 +1,21 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="application/javascript"
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<script>
function boom()
{
document.getElementById("k").removeAttribute("href");
ok(true, "changing iframe contents doesn't cause assertions");
SimpleTest.finish();
}
</script>
</head>
<body onload="boom();">
<iframe src="data:text/html,1"><link id="k" href="data:text/html,2" /></iframe>
</body>
</html>

Просмотреть файл

@ -3812,6 +3812,7 @@ if test "${BZ2_DIR}" -a -d "${BZ2_DIR}" -a "$MOZ_NATIVE_BZ2" = 1; then
MOZ_BZ2_LIBS="-L${BZ2_DIR}/lib ${MOZ_BZ2_LIBS}"
fi
dnl ========================================================
dnl system PNG Support
dnl ========================================================
MOZ_ARG_WITH_STRING(system-png,
@ -3856,10 +3857,37 @@ if test "${PNG_DIR}" -a -d "${PNG_DIR}" -a "$MOZ_NATIVE_PNG" = 1; then
MOZ_PNG_LIBS="-L${PNG_DIR}/lib ${MOZ_PNG_LIBS}"
fi
MOZ_PNG_ARM_NEON_CHECK=
if test "$MOZ_NATIVE_PNG" != 1 -a "$CPU_ARCH" = "arm" ; then
MOZ_ARG_ENABLE_STRING(png-arm-neon-support,
[ --enable-png-arm-neon-support=TYPE
Options include:
no
check (default)
nocheck (faster but unsafe)],
[MOZ_PNG_ARM_NEON_SUPPORT=$enableval ] )
case "$MOZ_PNG_ARM_NEON_SUPPORT" in
no)
# enable-png-arm-neon-support = no
;;
nocheck)
# enable-png-arm-neon-support = nocheck
MOZ_PNG_ARM_NEON=1
;;
*)
MOZ_PNG_ARM_NEON=1
MOZ_PNG_ARM_NEON_CHECK=1
;;
esac
fi
AC_SUBST(MOZ_PNG_ARM_NEON_CHECK)
fi # SKIP_LIBRARY_CHECKS
AC_SUBST(MOZ_PNG_ARM_NEON)
dnl ========================================================
dnl system HunSpell Support
dnl ========================================================
MOZ_ARG_ENABLE_BOOL(system-hunspell,

Просмотреть файл

@ -38,6 +38,4 @@ DEPRECATED_OPERATION(UseOfCaptureEvents)
DEPRECATED_OPERATION(UseOfReleaseEvents)
DEPRECATED_OPERATION(UseOfDOM3LoadMethod)
DEPRECATED_OPERATION(ShowModalDialog)
DEPRECATED_OPERATION(UnsafeCloneNode)
DEPRECATED_OPERATION(UnsafeImportNode)
DEPRECATED_OPERATION(Window_Content)

Просмотреть файл

@ -2016,15 +2016,6 @@ public:
mozilla::ErrorResult& rv) const;
already_AddRefed<nsINode>
ImportNode(nsINode& aNode, bool aDeep, mozilla::ErrorResult& rv) const;
already_AddRefed<nsINode>
ImportNode(nsINode& aNode, mozilla::ErrorResult& rv)
{
if (aNode.HasChildNodes()) {
// Flag it as an error, not a warning, to make people actually notice.
WarnOnceAbout(eUnsafeImportNode, true);
}
return ImportNode(aNode, true, rv);
}
nsINode* AdoptNode(nsINode& aNode, mozilla::ErrorResult& rv);
already_AddRefed<nsDOMEvent> CreateEvent(const nsAString& aEventType,
mozilla::ErrorResult& rv) const;

Просмотреть файл

@ -1546,7 +1546,6 @@ public:
return ReplaceOrInsertBefore(true, &aNode, &aChild, aError);
}
nsINode* RemoveChild(nsINode& aChild, mozilla::ErrorResult& aError);
already_AddRefed<nsINode> CloneNode(mozilla::ErrorResult& aError);
already_AddRefed<nsINode> CloneNode(bool aDeep, mozilla::ErrorResult& aError);
bool IsEqualNode(nsINode* aNode);
void GetNamespaceURI(nsAString& aNamespaceURI) const

Просмотреть файл

@ -1875,7 +1875,7 @@ GK_ATOM(svgPatternFrame, "SVGPatternFrame")
GK_ATOM(svgRadialGradientFrame, "SVGRadialGradientFrame")
GK_ATOM(svgStopFrame, "SVGStopFrame")
GK_ATOM(svgSwitchFrame, "SVGSwitchFrame")
GK_ATOM(svgTextFrame2, "SVGTextFrame2")
GK_ATOM(svgTextFrame, "SVGTextFrame")
GK_ATOM(svgUseFrame, "SVGUseFrame")
GK_ATOM(svgViewFrame, "SVGViewFrame")
GK_ATOM(HTMLVideoFrame, "VideoFrame")

Просмотреть файл

@ -2624,17 +2624,6 @@ nsINode::CloneNode(bool aDeep, ErrorResult& aError)
return result.forget();
}
already_AddRefed<nsINode>
nsINode::CloneNode(mozilla::ErrorResult& aError)
{
if (HasChildNodes()) {
// Flag it as an error, not a warning, to make people actually notice.
OwnerDoc()->WarnOnceAbout(nsIDocument::eUnsafeCloneNode, true);
}
return CloneNode(true, aError);
}
nsDOMAttributeMap*
nsINode::GetAttributes()
{

Просмотреть файл

@ -41,11 +41,11 @@
// Test Node.cloneNode when no arguments are given
clonedNode = hasChildren.cloneNode();
is(clonedNode.hasChildNodes(), true, "Node.cloneNode with true " +
"default on a node with children clones the child nodes.");
is(clonedNode.hasChildNodes(), false, "Node.cloneNode with false " +
"default on a node with children does not clone the child nodes.");
clonedNode = noChildren.cloneNode();
is(clonedNode.hasChildNodes(), false, "Node.cloneNode with true " +
is(clonedNode.hasChildNodes(), false, "Node.cloneNode with false " +
"default on a node without children doesn't clone child nodes." );
SimpleTest.finish();

Просмотреть файл

@ -1055,6 +1055,26 @@ CanvasRenderingContext2D::Render(gfxContext *ctx, GraphicsFilter aFilter, uint32
return rv;
}
NS_IMETHODIMP
CanvasRenderingContext2D::SetContextOptions(JSContext* aCx, JS::Handle<JS::Value> aOptions)
{
if (aOptions.isNullOrUndefined()) {
return NS_OK;
}
ContextAttributes2D attributes;
NS_ENSURE_TRUE(attributes.Init(aCx, aOptions), NS_ERROR_UNEXPECTED);
#ifdef USE_SKIA_GPU
if (Preferences::GetBool("gfx.canvas.willReadFrequently.enable", false)) {
// Use software when there is going to be a lot of readback
mForceSoftware = attributes.mWillReadFrequently;
}
#endif
return NS_OK;
}
void
CanvasRenderingContext2D::GetImageBuffer(uint8_t** aImageBuffer,
int32_t* aFormat)

Просмотреть файл

@ -413,6 +413,7 @@ public:
// this rect is in canvas device space
void Redraw(const mozilla::gfx::Rect &r);
NS_IMETHOD Redraw(const gfxRect &r) MOZ_OVERRIDE { Redraw(ToRect(r)); return NS_OK; }
NS_IMETHOD SetContextOptions(JSContext* aCx, JS::Handle<JS::Value> aOptions) MOZ_OVERRIDE;
// this rect is in mTarget's current user space
void RedrawUser(const gfxRect &r);

Просмотреть файл

@ -144,26 +144,14 @@ nsDOMMessageEvent::Constructor(const mozilla::dom::GlobalObject& aGlobal,
event->mLastEventId = aParam.mLastEventId.Value();
}
if (aParam.mSource) {
nsCOMPtr<nsIXPConnectWrappedNative> wrappedNative;
nsContentUtils::XPConnect()->
GetWrappedNativeOfJSObject(aCx, aParam.mSource,
getter_AddRefs(wrappedNative));
if (wrappedNative) {
event->mWindowSource = do_QueryWrappedNative(wrappedNative);
if (!aParam.mSource.IsNull()) {
if (aParam.mSource.Value().IsWindowProxy()) {
event->mWindowSource = aParam.mSource.Value().GetAsWindowProxy();
} else {
event->mPortSource = aParam.mSource.Value().GetAsMessagePort();
}
if (!event->mWindowSource) {
MessagePortBase* port = nullptr;
nsresult rv = UNWRAP_OBJECT(MessagePort, aParam.mSource, port);
if (NS_FAILED(rv)) {
aRv.Throw(NS_ERROR_INVALID_ARG);
return nullptr;
}
event->mPortSource = port;
}
MOZ_ASSERT(event->mWindowSource || event->mPortSource);
}
if (aParam.mPorts.WasPassed() && !aParam.mPorts.Value().IsNull()) {

Просмотреть файл

@ -70,7 +70,7 @@ private:
nsString mOrigin;
nsString mLastEventId;
nsCOMPtr<nsIDOMWindow> mWindowSource;
nsCOMPtr<mozilla::dom::MessagePortBase> mPortSource;
nsRefPtr<mozilla::dom::MessagePortBase> mPortSource;
nsRefPtr<mozilla::dom::MessagePortList> mPorts;
};

Просмотреть файл

@ -148,28 +148,27 @@ TextTrack::GetActiveCues()
// the active cue list from scratch.
if (mDirty) {
mCuePos = 0;
mDirty = true;
mDirty = false;
mActiveCueList->RemoveAll();
}
double playbackTime = mMediaElement->CurrentTime();
// Remove all the cues from the active cue list whose end times now occur
// earlier then the current playback time. When we reach a cue whose end time
// is valid we can safely stop iterating as the list is sorted.
for (uint32_t i = 0; i < mActiveCueList->Length() &&
(*mActiveCueList)[i]->EndTime() < playbackTime; i++) {
mActiveCueList->RemoveCueAt(i);
// earlier then the current playback time.
for (uint32_t i = mActiveCueList->Length(); i > 0; i--) {
if ((*mActiveCueList)[i - 1]->EndTime() < playbackTime) {
mActiveCueList->RemoveCueAt(i - 1);
}
}
// Add all the cues, starting from the position of the last cue that was
// added, that have valid start and end times for the current playback time.
// We can stop iterating safely once we encounter a cue that does not have
// valid times for the current playback time as the cue list is sorted.
for (; mCuePos < mCueList->Length(); mCuePos++) {
TextTrackCue* cue = (*mCueList)[mCuePos];
if (cue->StartTime() > playbackTime || cue->EndTime() < playbackTime) {
break;
// a valid start time as the cue list is sorted.
for (; mCuePos < mCueList->Length() &&
(*mCueList)[mCuePos]->StartTime() <= playbackTime; mCuePos++) {
if ((*mCueList)[mCuePos]->EndTime() >= playbackTime) {
mActiveCueList->AddCue(*(*mCueList)[mCuePos]);
}
mActiveCueList->AddCue(*cue);
}
return mActiveCueList;
}

Просмотреть файл

@ -10,9 +10,6 @@
#include "nsComponentManagerUtils.h"
#include "mozilla/ClearOnShutdown.h"
// Alternate value for the 'auto' keyword.
#define WEBVTT_AUTO -1
namespace mozilla {
namespace dom {
@ -39,8 +36,9 @@ TextTrackCue::SetDefaultCueSettings()
mSize = 100;
mPauseOnExit = false;
mSnapToLines = true;
mLine = WEBVTT_AUTO;
mLine.SetAsAutoKeyword() = AutoKeyword::Auto;
mAlign = AlignSetting::Middle;
mLineAlign = AlignSetting::Start;
mVertical = DirectionSetting::_empty;
}

Просмотреть файл

@ -14,6 +14,7 @@
#include "nsIWebVTTParserWrapper.h"
#include "mozilla/StaticPtr.h"
#include "nsIDocument.h"
#include "mozilla/dom/UnionTypes.h"
namespace mozilla {
namespace dom {
@ -82,8 +83,9 @@ public:
void SetStartTime(double aStartTime)
{
if (mStartTime == aStartTime)
if (mStartTime == aStartTime) {
return;
}
mStartTime = aStartTime;
CueChanged();
@ -96,8 +98,9 @@ public:
void SetEndTime(double aEndTime)
{
if (mEndTime == aEndTime)
if (mEndTime == aEndTime) {
return;
}
mEndTime = aEndTime;
CueChanged();
@ -110,8 +113,9 @@ public:
void SetPauseOnExit(bool aPauseOnExit)
{
if (mPauseOnExit == aPauseOnExit)
if (mPauseOnExit == aPauseOnExit) {
return;
}
mPauseOnExit = aPauseOnExit;
CueChanged();
@ -139,8 +143,9 @@ public:
void SetVertical(const DirectionSetting& aVertical)
{
if (mVertical == aVertical)
if (mVertical == aVertical) {
return;
}
mReset = true;
mVertical = aVertical;
@ -154,24 +159,58 @@ public:
void SetSnapToLines(bool aSnapToLines)
{
if (mSnapToLines == aSnapToLines)
if (mSnapToLines == aSnapToLines) {
return;
}
mReset = true;
mSnapToLines = aSnapToLines;
CueChanged();
}
double Line() const
void GetLine(OwningLongOrAutoKeyword& aLine) const
{
return mLine;
if (mLine.IsLong()) {
aLine.SetAsLong() = mLine.GetAsLong();
return;
}
aLine.SetAsAutoKeyword() = mLine.GetAsAutoKeyword();
}
void SetLine(double aLine)
void SetLine(const LongOrAutoKeyword& aLine)
{
//XXX: TODO Line position can be a keyword auto. bug882299
if (aLine.IsLong() &&
(mLine.IsAutoKeyword() || (aLine.GetAsLong() != mLine.GetAsLong()))) {
mLine.SetAsLong() = aLine.GetAsLong();
CueChanged();
mReset = true;
return;
}
if (mLine.IsLong()) {
mLine.SetAsAutoKeyword() = aLine.GetAsAutoKeyword();
CueChanged();
mReset = true;
}
}
AlignSetting LineAlign() const
{
return mLineAlign;
}
void SetLineAlign(AlignSetting& aLineAlign, ErrorResult& aRv)
{
if (mLineAlign == aLineAlign)
return;
if (aLineAlign == AlignSetting::Left ||
aLineAlign == AlignSetting::Right) {
return aRv.Throw(NS_ERROR_DOM_SYNTAX_ERR);
}
mReset = true;
mLine = aLine;
mLineAlign = aLineAlign;
CueChanged();
}
int32_t Position() const
@ -181,9 +220,9 @@ public:
void SetPosition(int32_t aPosition, ErrorResult& aRv)
{
// XXXhumph: validate? bug 868519.
if (mPosition == aPosition)
if (mPosition == aPosition) {
return;
}
if (aPosition > 100 || aPosition < 0){
aRv.Throw(NS_ERROR_DOM_INDEX_SIZE_ERR);
@ -223,8 +262,9 @@ public:
void SetAlign(AlignSetting& aAlign)
{
if (mAlign == aAlign)
if (mAlign == aAlign) {
return;
}
mReset = true;
mAlign = aAlign;
@ -238,8 +278,9 @@ public:
void SetText(const nsAString& aText)
{
if (mText == aText)
if (mText == aText) {
return;
}
mReset = true;
mText = aText;
@ -322,8 +363,9 @@ private:
bool mSnapToLines;
nsString mRegionId;
DirectionSetting mVertical;
int mLine;
LongOrAutoKeyword mLine;
AlignSetting mAlign;
AlignSetting mLineAlign;
// Holds the computed DOM elements that represent the parsed cue text.
// http://www.whatwg.org/specs/web-apps/current-work/#text-track-cue-display-state

Просмотреть файл

@ -8,10 +8,18 @@ This
00:01.200 --> 00:02.400
Is
2.5
00:02.000 --> 00:03.500
(Over here?!)
3
00:02.710 --> 00:02.910
A
3
4
00:03.217 --> 00:03.989
Test
Test
5
00:03.217 --> 00:03.989
And more!

Просмотреть файл

@ -8,16 +8,19 @@ function check_webm(v, enabled) {
check("audio/webm", "maybe");
// Supported Webm codecs
check("audio/webm; codecs=vorbis", "probably");
check("video/webm; codecs=vorbis", "probably");
check("video/webm; codecs=vorbis,vp8", "probably");
check("video/webm; codecs=vorbis,vp8.0", "probably");
check("video/webm; codecs=\"vorbis,vp8\"", "probably");
check("video/webm; codecs=\"vorbis,vp8.0\"", "probably");
check("video/webm; codecs=\"vp8, vorbis\"", "probably");
check("video/webm; codecs=\"vp8.0, vorbis\"", "probably");
check("video/webm; codecs=vp8", "probably");
check("video/webm; codecs=vp8.0", "probably");
var video = ['vp8', 'vp8.0', 'vp9', 'vp9.0'];
var audio = ['vorbis', 'opus'];
audio.forEach(function(acodec) {
check("audio/webm; codecs=" + acodec, "probably");
check("video/webm; codecs=" + acodec, "probably");
});
video.forEach(function(vcodec) {
check("video/webm; codecs=" + vcodec, "probably");
audio.forEach(function(acodec) {
check("video/webm; codecs=\"" + vcodec + ", " + acodec + "\"", "probably");
check("video/webm; codecs=\"" + acodec + ", " + vcodec + "\"", "probably");
});
});
// Unsupported WebM codecs
check("video/webm; codecs=xyz", "");

Двоичные данные
content/media/test/detodos.webm Normal file

Двоичный файл не отображается.

Просмотреть файл

@ -11,6 +11,7 @@ var gSmallTests = [
{ name:"r11025_s16_c1.wav", type:"audio/x-wav", duration:1.0 },
{ name:"320x240.ogv", type:"video/ogg", width:320, height:240, duration:0.266 },
{ name:"seek.webm", type:"video/webm", width:320, height:240, duration:3.966 },
{ name:"vp9.webm", type:"video/webm", width:320, height:240, duration:4 },
{ name:"detodos.opus", type:"audio/ogg; codecs=opus", duration:2.9135 },
{ name:"gizmo.mp4", type:"video/mp4", duration:5.56 },
{ name:"bogus.duh", type:"bogus/duh" }
@ -156,6 +157,10 @@ var gPlayTests = [
// Test playback of a WebM file with non-zero start time.
{ name:"split.webm", type:"video/webm", duration:1.967 },
// Test playback of a WebM file with vp9 video
//{ name:"vp9.webm", type:"video/webm", duration:4 },
{ name:"vp9cake.webm", type:"video/webm", duration:7.966 },
// Test playback of a raw file
{ name:"seek.yuv", type:"video/x-raw-yuv", duration:1.833 },
@ -166,6 +171,8 @@ var gPlayTests = [
// Opus data in an ogg container
{ name:"detodos.opus", type:"audio/ogg; codecs=opus", duration:2.9135 },
// Opus data in a webm container
{ name:"detodos.webm", type:"audio/webm; codecs=opus", duration:2.9135 },
// Multichannel Opus in an ogg container
{ name:"test-1-mono.opus", type:"audio/ogg; codecs=opus", duration:1.044 },

Просмотреть файл

@ -88,6 +88,7 @@ support-files =
contentDuration7.sjs
contentType.sjs
detodos.opus
detodos.webm
dirac.ogg
dynamic_redirect.sjs
dynamic_resource.sjs
@ -130,6 +131,8 @@ support-files =
region.vtt
seek.ogv
seek.webm
vp9.webm
vp9cake.webm
seek.yuv
seek1.js
seek10.js

Просмотреть файл

@ -37,7 +37,7 @@ SpecialPowers.pushPrefEnv({"set": [["media.webvtt.enabled", true]]},
is(trackElement.readyState, 2, "Track::ReadyState should be set to LOADED.");
var cueList = trackElement.track.cues;
is(cueList.length, 4, "Cue list length should be 4.");
is(cueList.length, 6, "Cue list length should be 6.");
// Check that the typedef of TextTrackCue works in Gecko.
is(window.TextTrackCue, undefined, "TextTrackCue should be undefined.");
@ -57,41 +57,80 @@ SpecialPowers.pushPrefEnv({"set": [["media.webvtt.enabled", true]]},
// Check that all cue times were not rounded
is(cueList[1].startTime, 1.2, "Second cue's start time should be 1.2.");
is(cueList[1].endTime, 2.4, "Second cue's end time should be 2.4.");
is(cueList[2].startTime, 2.71, "Third cue's start time should be 2.71.");
is(cueList[2].endTime, 2.91, "Third cue's end time should be 2.91.");
is(cueList[3].startTime, 3.217, "Fourth cue's start time should be 3.217.");
is(cueList[3].endTime, 3.989, "Fourth cue's end time should be 3.989.");
is(cueList[2].startTime, 2, "Third cue's start time should be 2.");
is(cueList[2].endTime, 3.5, "Third cue's end time should be 3.5.");
is(cueList[3].startTime, 2.71, "Fourth cue's start time should be 2.71.");
is(cueList[3].endTime, 2.91, "Fourth cue's end time should be 2.91.");
is(cueList[4].startTime, 3.217, "Fifth cue's start time should be 3.217.");
is(cueList[4].endTime, 3.989, "Fifth cue's end time should be 3.989.");
is(cueList[5].startTime, 3.217, "Sixth cue's start time should be 3.217.");
is(cueList[5].endTime, 3.989, "Sixth cue's end time should be 3.989.");
// Check that Cue setters are working correctly.
cue.id = "Cue 01";
is(cue.id, "Cue 01", "Cue's ID should be 'Cue 01'.");
cue.startTime = 1.5;
is(cue.startTime, 1.5, "Cue's start time should be 1.5.");
cue.endTime = 2.5;
is(cue.endTime, 2.5, "Cue's end time should be 2.5.");
cue.startTime = 0.51;
is(cue.startTime, 0.51, "Cue's start time should be 0.51.");
cue.endTime = 0.71;
is(cue.endTime, 0.71, "Cue's end time should be 0.71.");
cue.pauseOnExit = true;
is(cue.pauseOnExit, true, "Cue's pause on exit flag should be true.");
// Check that cue line align works properly
is(cue.lineAlign, "start", "Cue's default line alignment should be start.");
var exceptionHappened = false;
try {
cue.lineAlign = "left";
} catch(e) {
exceptionHappened = true;
is(e.name, "SyntaxError", "Should have thrown SyntaxError.");
}
ok(exceptionHappened, "Exception should have happened.");
exceptionHappened = false;
try {
cue.lineAlign = "right";
} catch(e) {
exceptionHappened = true;
is(e.name, "SyntaxError", "Should have thrown SyntaxError.");
}
ok(exceptionHappened, "Exception should have happened.");
cue.lineAlign = "middle";
is(cue.lineAlign, "middle", "Cue's line align should be middle.");
cue.lineAlign = "START";
is(cue.lineAlign, "middle", "Cue's line align should be middle.");
cue.lineAlign = "end";
is(cue.lineAlign, "end", "Cue's line align should be end.");
// Check cue.line
is(cue.line, "auto", "Cue's line value should initially be auto.");
cue.line = 12410
is(cue.line, 12410, "Cue's line value should now be 12410.");
cue.line = "auto";
is(cue.line, "auto", "Cue's line value should now be auto.");
// Check that we can create and add new VTTCues
var vttCue = new VTTCue(3.999, 4, "foo");
trackElement.track.addCue(vttCue);
is(cueList.length, 5, "Cue list length should now be 5.");
is(cueList.length, 7, "Cue list length should now be 7.");
// Check that new VTTCue was added correctly
cue = cueList[4];
cue = cueList[6];
is(cue.startTime, 3.999, "Cue's start time should be 3.999.");
is(cue.endTime, 4, "Cue's end time should be 4.");
is(cue.text, "foo", "Cue's text should be foo.");
// Adding the same cue again should not increase the cue count.
trackElement.track.addCue(vttCue);
is(cueList.length, 5, "Cue list length should be 5.");
is(cueList.length, 7, "Cue list length should be 7.");
// Check that we are able to remove cues.
trackElement.track.removeCue(cue);
is(cueList.length, 4, "Cue list length should be 4.");
is(cueList.length, 6, "Cue list length should be 6.");
var exceptionHappened = false;
exceptionHappened = false;
try {
// We should not be able to remove a cue that is not in the list.
cue = new VTTCue(1, 2, "foo");
@ -106,9 +145,45 @@ SpecialPowers.pushPrefEnv({"set": [["media.webvtt.enabled", true]]},
// when we shouln't have.
ok(exceptionHappened, "Exception should have happened.");
is(cueList.length, 4, "Cue list length should be 4.");
is(cueList.length, 6, "Cue list length should be 6.");
SimpleTest.finish();
// Test TextTrack::ActiveCues.
var cueInfo = [
{ startTime: 0.51, endTime: 0.71, ids: ["Cue 01"] },
{ startTime: 1.2, endTime: 2, ids: [2] },
{ startTime: 2, endTime: 2.4, ids: [2, 2.5] },
{ startTime: 2.4, endTime: 2.71, ids: [2.5] },
{ startTime: 2.71, endTime: 2.91, ids: [2.5, 3] },
{ startTime: 2.91, endTime: 3.217, ids: [2.5] },
{ startTime: 3.217, endTime: 3.5, ids: [2.5, 4, 5] },
{ startTime: 3.50, endTime: 3.989, ids: [4, 5] }
];
video.addEventListener("timeupdate", function() {
var activeCues = trackElement.track.activeCues,
found = false,
playbackTime = video.currentTime;
for (var i = 0; i < cueInfo.length && !found; i++) {
var cue = cueInfo[i];
if (playbackTime >= cue.startTime && playbackTime <= cue.endTime) {
is(activeCues.length, cue.ids.length, "There should be " + cue.ids.length + " currently active cue(s).");
for (var j = 0; j < cue.ids.length; j++) {
isnot(activeCues.getCueById(cue.ids[j]), undefined, "The cue with ID " + cue.ids[j] + " should be active.");
}
found = true;
}
}
if (!found) {
is(activeCues.length, 0, "There should be 0 currently active cues.");
}
});
video.addEventListener("ended", function(){
SimpleTest.finish();
});
video.play();
});
}
);

Двоичные данные
content/media/test/vp9.webm Normal file

Двоичный файл не отображается.

Двоичные данные
content/media/test/vp9cake.webm Normal file

Двоичный файл не отображается.

Просмотреть файл

@ -5,7 +5,7 @@
#include "mozilla/dom/SVGTextContentElement.h"
#include "nsISVGPoint.h"
#include "nsSVGTextFrame2.h"
#include "SVGTextFrame.h"
#include "mozilla/dom/SVGIRect.h"
namespace mozilla {
@ -27,12 +27,12 @@ nsSVGElement::LengthInfo SVGTextContentElement::sLengthInfo[1] =
{ &nsGkAtoms::textLength, 0, nsIDOMSVGLength::SVG_LENGTHTYPE_NUMBER, SVGContentUtils::XY }
};
nsSVGTextFrame2*
SVGTextFrame*
SVGTextContentElement::GetSVGTextFrame()
{
nsIFrame* frame = GetPrimaryFrame(Flush_Layout);
while (frame) {
nsSVGTextFrame2* textFrame = do_QueryFrame(frame);
SVGTextFrame* textFrame = do_QueryFrame(frame);
if (textFrame) {
return textFrame;
}
@ -58,21 +58,21 @@ SVGTextContentElement::LengthAdjust()
int32_t
SVGTextContentElement::GetNumberOfChars()
{
nsSVGTextFrame2* textFrame = GetSVGTextFrame();
SVGTextFrame* textFrame = GetSVGTextFrame();
return textFrame ? textFrame->GetNumberOfChars(this) : 0;
}
float
SVGTextContentElement::GetComputedTextLength()
{
nsSVGTextFrame2* textFrame = GetSVGTextFrame();
SVGTextFrame* textFrame = GetSVGTextFrame();
return textFrame ? textFrame->GetComputedTextLength(this) : 0.0f;
}
void
SVGTextContentElement::SelectSubString(uint32_t charnum, uint32_t nchars, ErrorResult& rv)
{
nsSVGTextFrame2* textFrame = GetSVGTextFrame();
SVGTextFrame* textFrame = GetSVGTextFrame();
if (!textFrame)
return;
@ -82,7 +82,7 @@ SVGTextContentElement::SelectSubString(uint32_t charnum, uint32_t nchars, ErrorR
float
SVGTextContentElement::GetSubStringLength(uint32_t charnum, uint32_t nchars, ErrorResult& rv)
{
nsSVGTextFrame2* textFrame = GetSVGTextFrame();
SVGTextFrame* textFrame = GetSVGTextFrame();
if (!textFrame)
return 0.0f;
@ -94,7 +94,7 @@ SVGTextContentElement::GetSubStringLength(uint32_t charnum, uint32_t nchars, Err
already_AddRefed<nsISVGPoint>
SVGTextContentElement::GetStartPositionOfChar(uint32_t charnum, ErrorResult& rv)
{
nsSVGTextFrame2* textFrame = GetSVGTextFrame();
SVGTextFrame* textFrame = GetSVGTextFrame();
if (!textFrame) {
rv.Throw(NS_ERROR_FAILURE);
return nullptr;
@ -108,7 +108,7 @@ SVGTextContentElement::GetStartPositionOfChar(uint32_t charnum, ErrorResult& rv)
already_AddRefed<nsISVGPoint>
SVGTextContentElement::GetEndPositionOfChar(uint32_t charnum, ErrorResult& rv)
{
nsSVGTextFrame2* textFrame = GetSVGTextFrame();
SVGTextFrame* textFrame = GetSVGTextFrame();
if (!textFrame) {
rv.Throw(NS_ERROR_FAILURE);
return nullptr;
@ -122,7 +122,7 @@ SVGTextContentElement::GetEndPositionOfChar(uint32_t charnum, ErrorResult& rv)
already_AddRefed<SVGIRect>
SVGTextContentElement::GetExtentOfChar(uint32_t charnum, ErrorResult& rv)
{
nsSVGTextFrame2* textFrame = GetSVGTextFrame();
SVGTextFrame* textFrame = GetSVGTextFrame();
if (!textFrame) {
rv.Throw(NS_ERROR_FAILURE);
@ -137,7 +137,7 @@ SVGTextContentElement::GetExtentOfChar(uint32_t charnum, ErrorResult& rv)
float
SVGTextContentElement::GetRotationOfChar(uint32_t charnum, ErrorResult& rv)
{
nsSVGTextFrame2* textFrame = GetSVGTextFrame();
SVGTextFrame* textFrame = GetSVGTextFrame();
if (!textFrame) {
rv.Throw(NS_ERROR_FAILURE);
@ -152,7 +152,7 @@ SVGTextContentElement::GetRotationOfChar(uint32_t charnum, ErrorResult& rv)
int32_t
SVGTextContentElement::GetCharNumAtPosition(nsISVGPoint& aPoint)
{
nsSVGTextFrame2* textFrame = GetSVGTextFrame();
SVGTextFrame* textFrame = GetSVGTextFrame();
return textFrame ? textFrame->GetCharNumAtPosition(this, &aPoint) : -1;
}

Просмотреть файл

@ -15,7 +15,7 @@ static const unsigned short SVG_LENGTHADJUST_UNKNOWN = 0;
static const unsigned short SVG_LENGTHADJUST_SPACING = 1;
static const unsigned short SVG_LENGTHADJUST_SPACINGANDGLYPHS = 2;
class nsSVGTextFrame2;
class SVGTextFrame;
namespace mozilla {
class nsISVGPoint;
@ -50,7 +50,7 @@ protected:
: SVGTextContentElementBase(aNodeInfo)
{}
nsSVGTextFrame2* GetSVGTextFrame();
SVGTextFrame* GetSVGTextFrame();
enum { LENGTHADJUST };
virtual nsSVGEnum* EnumAttributes() = 0;

Просмотреть файл

@ -34,7 +34,7 @@ typedef SVGTextContentElement SVGTextPathElementBase;
class SVGTextPathElement MOZ_FINAL : public SVGTextPathElementBase
{
friend class ::nsSVGTextFrame2;
friend class ::SVGTextFrame;
protected:
friend nsresult (::NS_NewSVGTextPathElement(nsIContent **aResult,

Просмотреть файл

@ -307,9 +307,9 @@ nsGlobalWindow::DOMMinTimeoutValue() const {
PR_BEGIN_MACRO \
if (IsInnerWindow()) { \
nsGlobalWindow *outer = GetOuterWindowInternal(); \
if (!outer || outer->GetCurrentInnerWindow() != this) { \
if (!HasActiveDocument()) { \
NS_WARNING(outer ? \
"Inner window is not its outer's current inner window." : \
"Inner window does not have active document." : \
"No outer window available!"); \
return err_rval; \
} \
@ -321,11 +321,13 @@ nsGlobalWindow::DOMMinTimeoutValue() const {
PR_BEGIN_MACRO \
if (IsInnerWindow()) { \
nsGlobalWindow *outer = GetOuterWindowInternal(); \
if (!outer) { \
NS_WARNING("No outer window available!"); \
errorresult.Throw(NS_ERROR_NOT_INITIALIZED); \
} else if (outer->GetCurrentInnerWindow() != this) { \
errorresult.Throw(NS_ERROR_XPC_SECURITY_MANAGER_VETO); \
if (!HasActiveDocument()) { \
if (!outer) { \
NS_WARNING("No outer window available!"); \
errorresult.Throw(NS_ERROR_NOT_INITIALIZED); \
} else { \
errorresult.Throw(NS_ERROR_XPC_SECURITY_MANAGER_VETO); \
} \
} else { \
return outer->method args; \
} \
@ -337,9 +339,9 @@ nsGlobalWindow::DOMMinTimeoutValue() const {
PR_BEGIN_MACRO \
if (IsInnerWindow()) { \
nsGlobalWindow *outer = GetOuterWindowInternal(); \
if (!outer || outer->GetCurrentInnerWindow() != this) { \
if (!HasActiveDocument()) { \
NS_WARNING(outer ? \
"Inner window is not its outer's current inner window." : \
"Inner window does not have active document." : \
"No outer window available!"); \
return; \
} \
@ -352,9 +354,9 @@ nsGlobalWindow::DOMMinTimeoutValue() const {
PR_BEGIN_MACRO \
if (IsInnerWindow()) { \
nsGlobalWindow *outer = GetOuterWindowInternal(); \
if (!outer || outer->GetCurrentInnerWindow() != this) { \
if (!HasActiveDocument()) { \
NS_WARNING(outer ? \
"Inner window is not its outer's current inner window." : \
"Inner window does not have active document." : \
"No outer window available!"); \
return err_rval; \
} \
@ -377,9 +379,9 @@ nsGlobalWindow::DOMMinTimeoutValue() const {
PR_BEGIN_MACRO \
if (IsInnerWindow()) { \
nsGlobalWindow *outer = GetOuterWindowInternal(); \
if (!outer || outer->GetCurrentInnerWindow() != this) { \
if (!HasActiveDocument()) { \
NS_WARNING(outer ? \
"Inner window is not its outer's current inner window." : \
"Inner window does not have active document." : \
"No outer window available!"); \
return err_rval; \
} \

Просмотреть файл

@ -388,6 +388,12 @@ public:
return *ptr;
}
operator T*() {
MOZ_ASSERT(inited);
MOZ_ASSERT(ptr, "NonNull<T> was set to null");
return ptr;
}
void operator=(T* t) {
ptr = t;
MOZ_ASSERT(ptr);

Просмотреть файл

@ -839,8 +839,10 @@ def UnionTypes(descriptors, dictionaries, callbacks, config):
# And if it needs rooting, we need RootedDictionary too
if typeNeedsRooting(f):
headers.add("mozilla/dom/RootedDictionary.h")
elif t.isPrimitive():
implheaders.add("mozilla/dom/PrimitiveConversions.h")
elif f.isEnum():
# Need to see the actual definition of the enum,
# unfortunately.
headers.add(CGHeaders.getDeclarationFilename(f.inner))
map(addInfoForType, getAllTypes(descriptors, dictionaries, callbacks))
@ -876,7 +878,15 @@ def UnionConversions(descriptors, dictionaries, callbacks, config):
if f.isSpiderMonkeyInterface():
headers.add("jsfriendapi.h")
headers.add("mozilla/dom/TypedArray.h")
elif not f.inner.isExternal():
elif f.inner.isExternal():
providers = getRelevantProviders(descriptor, config)
for p in providers:
try:
typeDesc = p.getDescriptor(f.inner.identifier.name)
except NoSuchDescriptorError:
continue
headers.add(typeDesc.headerFile)
else:
headers.add(CGHeaders.getDeclarationFilename(f.inner))
# Check for whether we have a possibly-XPConnect-implemented
# interface. If we do, the right descriptor will come from

Просмотреть файл

@ -31,6 +31,13 @@ public:
return *mPtr;
}
operator T*()
{
MOZ_ASSERT(mInited);
MOZ_ASSERT(mPtr, "OwningNonNull<T> was set to null");
return mPtr;
}
void operator=(T* aValue)
{
init(aValue);

Просмотреть файл

@ -17,16 +17,22 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=882541
var div2;
div2 = div.cloneNode();
is(div2.childNodes.length, 1, "cloneNode() should do a deep clone");
is(div2.childNodes.length, 0, "cloneNode() should do a shallow clone");
div2 = div.cloneNode(undefined);
is(div2.childNodes.length, 0, "cloneNode(undefined) should do a shallow clone");
div2 = div.cloneNode(true);
is(div2.childNodes.length, 1, "cloneNode(true) should do a deep clone");
div2 = document.importNode(div);
is(div2.childNodes.length, 1, "importNode(node) should do a deep import");
is(div2.childNodes.length, 0, "importNode(node) should do a deep import");
div2 = document.importNode(div, undefined);
is(div2.childNodes.length, 0, "cloneNode(undefined) should do a shallow import");
is(div2.childNodes.length, 0, "importNode(undefined) should do a shallow import");
div2 = document.importNode(div, true);
is(div2.childNodes.length, 1, "importNode(true) should do a deep import");
</script>
</head>

Просмотреть файл

@ -279,7 +279,7 @@ const ContentPanning = {
this._activationTimer.cancel();
}
if (this.panning) {
if (this.panning && docShell.asyncPanZoomEnabled === false) {
// Only do this when we're actually executing a pan gesture.
// Otherwise synthetic mouse events will be canceled.
evt.stopPropagation();

Просмотреть файл

@ -6,8 +6,6 @@
TEST_DIRS += ['mochitest']
XPIDL_MODULE = 'dom_browserelement'
EXPORTS.mozilla += [
'BrowserElementParent.h',
]

Просмотреть файл

@ -4,8 +4,6 @@
# 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/.
XPIDL_MODULE = 'dom_cellbroadcast'
EXPORTS.mozilla.dom += [
'CellBroadcast.h',
]

Просмотреть файл

@ -6,8 +6,6 @@
TEST_DIRS += ['test', 'ipc']
XPIDL_MODULE = 'dom_devicestorage'
EXPORTS += [
'DeviceStorage.h',
'nsDeviceStorage.h',

Просмотреть файл

@ -16,7 +16,7 @@ test(function() {
assert_equals(div.ownerDocument, doc);
assert_equals(div.firstChild.ownerDocument, doc);
assert_equals(newDiv.ownerDocument, document);
assert_equals(newDiv.firstChild.ownerDocument, document);
assert_equals(newDiv.firstChild, null);
}, "No 'deep' argument.")
test(function() {
var doc = document.implementation.createHTMLDocument("Title");

Просмотреть файл

@ -96,6 +96,7 @@
#include "nsIWebBrowserChrome.h"
#include "nsIDocShell.h"
#include "mozilla/net/NeckoMessageUtils.h"
#include "gfxPlatform.h"
#if defined(ANDROID) || defined(LINUX)
#include "nsSystemInfo.h"
@ -1385,7 +1386,7 @@ ContentParent::InitInternal(ProcessPriority aInitialPriority,
DebugOnly<bool> opened = PCompositor::Open(this);
MOZ_ASSERT(opened);
if (Preferences::GetBool("layers.async-video.enabled",false)) {
if (gfxPlatform::AsyncVideoEnabled()) {
opened = PImageBridge::Open(this);
MOZ_ASSERT(opened);
}

Просмотреть файл

@ -288,6 +288,7 @@ TabChild::TabChild(ContentChild* aManager, const TabContext& aContext, uint32_t
, mOrientation(eScreenOrientation_PortraitPrimary)
, mUpdateHitRegion(false)
, mContextMenuHandled(false)
, mWaitingTouchListeners(false)
{
}
@ -1868,16 +1869,43 @@ TabChild::RecvRealTouchEvent(const WidgetTouchEvent& aEvent,
WidgetTouchEvent localEvent(aEvent);
nsEventStatus status = DispatchWidgetEvent(localEvent);
if (IsAsyncPanZoomEnabled()) {
nsCOMPtr<nsPIDOMWindow> outerWindow = do_GetInterface(mWebNav);
nsCOMPtr<nsPIDOMWindow> innerWindow = outerWindow->GetCurrentInnerWindow();
if (innerWindow && innerWindow->HasTouchEventListeners()) {
SendContentReceivedTouch(aGuid, nsIPresShell::gPreventMouseEvents ||
localEvent.mFlags.mMultipleActionsPrevented);
}
} else {
if (!IsAsyncPanZoomEnabled()) {
UpdateTapState(localEvent, status);
return true;
}
nsCOMPtr<nsPIDOMWindow> outerWindow = do_GetInterface(mWebNav);
nsCOMPtr<nsPIDOMWindow> innerWindow = outerWindow->GetCurrentInnerWindow();
if (!innerWindow || !innerWindow->HasTouchEventListeners()) {
SendContentReceivedTouch(aGuid, false);
return true;
}
bool isTouchPrevented = nsIPresShell::gPreventMouseEvents ||
localEvent.mFlags.mMultipleActionsPrevented;
switch (aEvent.message) {
case NS_TOUCH_START: {
if (isTouchPrevented) {
SendContentReceivedTouch(aGuid, isTouchPrevented);
} else {
mWaitingTouchListeners = true;
}
break;
}
case NS_TOUCH_MOVE:
case NS_TOUCH_END:
case NS_TOUCH_CANCEL: {
if (mWaitingTouchListeners) {
SendContentReceivedTouch(aGuid, isTouchPrevented);
mWaitingTouchListeners = false;
}
break;
}
default:
NS_WARNING("Unknown touch event type");
}
return true;

Просмотреть файл

@ -499,6 +499,7 @@ private:
ScreenOrientation mOrientation;
bool mUpdateHitRegion;
bool mContextMenuHandled;
bool mWaitingTouchListeners;
DISALLOW_EVIL_CONSTRUCTORS(TabChild);
};

Просмотреть файл

@ -142,9 +142,5 @@ UseOfReleaseEventsWarning=Use of releaseEvents() is deprecated. To upgrade your
UseOfDOM3LoadMethodWarning=Use of document.load() is deprecated. To upgrade your code, use the DOM XMLHttpRequest object. For more help https://developer.mozilla.org/en/XMLHttpRequest
# LOCALIZATION NOTE: Do not translate "window.showModalDialog()" or "window.open()"
ShowModalDialogWarning=Use of window.showModalDialog() is deprecated. Use window.open() instead. For more help https://developer.mozilla.org/en-US/docs/Web/API/Window.open
# LOCALIZATION NOTE: Do not translate "cloneNode()"
UnsafeCloneNodeWarning=The behavior of cloneNode() with no boolean argument is about to change from doing a deep clone to doing a shallow clone. Make sure to pass an explicit boolean argument to keep your current behavior.
# LOCALIZATION NOTE: Do not translate "importNode()"
UnsafeImportNodeWarning=The behavior of importNode() with no boolean argument is about to change from doing a deep clone to doing a shallow clone. Make sure to pass an explicit boolean argument to keep your current behavior.
# LOCALIZATION NOTE: Do not translate "window._content" or "window.content"
Window_ContentWarning=window._content is deprecated. Please use window.content instead.

Просмотреть файл

@ -6,8 +6,6 @@
TEST_DIRS += ['tests']
XPIDL_MODULE = 'dom_promise'
EXPORTS.mozilla.dom += [
'Promise.h',
'PromiseNativeHandler.h'

Просмотреть файл

@ -6,8 +6,6 @@
MOCHITEST_MANIFESTS += ['tests/mochitest.ini']
XPIDL_MODULE = 'dom_speakermanager'
EXPORTS += [
'SpeakerManager.h',
'SpeakerManagerService.h',

Просмотреть файл

@ -23,8 +23,8 @@ var d = document.createElement("div");
d.innerHTML = "<span>hello </span><span>world</span>";
var imported = document.importNode(d);
is(imported.childNodes.length, 2, "Should have cloned child nodes!");
is(imported.textContent, "hello world", "Should have cloned text!");
is(imported.childNodes.length, 0, "Should not have cloned child nodes with no deep arg!");
is(imported.textContent, "", "Should not have cloned text with no deep arg!");
imported = document.importNode(d, true);
is(imported.childNodes.length, 2, "Should have cloned child nodes!");

Просмотреть файл

@ -3,8 +3,3 @@
# 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/.
XPIDL_SOURCES += [
]
XPIDL_MODULE = 'dom_wappush'

Просмотреть файл

@ -15,6 +15,11 @@ interface HitRegionOptions;
enum CanvasWindingRule { "nonzero", "evenodd" };
dictionary ContextAttributes2D {
// whether or not we're planning to do a lot of readback operations
boolean willReadFrequently = false;
};
interface CanvasRenderingContext2D {
// back-reference to the canvas. Might be null if we're not

Просмотреть файл

@ -66,9 +66,7 @@ interface Document : Node {
ProcessingInstruction createProcessingInstruction(DOMString target, DOMString data);
[Throws]
Node importNode(Node node, boolean deep);
[Throws]
Node importNode(Node node);
Node importNode(Node node, optional boolean deep = false);
[Throws]
Node adoptNode(Node node);

Просмотреть файл

@ -48,9 +48,6 @@ dictionary MessageEventInit : EventInit {
any data;
DOMString origin;
DOMString lastEventId;
// TODO bug 767926 - This should be: (WindowProxy or MessagePort)? source;
object? source = null;
(WindowProxy or MessagePort)? source = null;
sequence<MessagePort>? ports;
};

Просмотреть файл

@ -69,9 +69,7 @@ interface Node : EventTarget {
void normalize();
[Throws]
Node cloneNode();
[Throws]
Node cloneNode(boolean deep);
Node cloneNode(optional boolean deep = false);
[Pure]
boolean isEqualNode(Node? node);

Просмотреть файл

@ -35,8 +35,9 @@ interface VTTCue : EventTarget {
attribute DOMString regionId;
attribute DirectionSetting vertical;
attribute boolean snapToLines;
// XXXhumph: https://www.w3.org/Bugs/Public/show_bug.cgi?id=20651
// attribute (long or AutoKeyword) line;
attribute (long or AutoKeyword) line;
[SetterThrows]
attribute AlignSetting lineAlign;
[SetterThrows]
attribute long position;
[SetterThrows]

Просмотреть файл

@ -3540,7 +3540,7 @@ WorkerPrivate::WorkerPrivate(JSContext* aCx,
mRunningExpiredTimeouts(false), mCloseHandlerStarted(false),
mCloseHandlerFinished(false), mMemoryReporterRunning(false),
mBlockedForMemoryReporter(false), mCancelAllPendingRunnables(false),
mPeriodicGCTimerRunning(false)
mPeriodicGCTimerRunning(false), mIdleGCTimerRunning(false)
#ifdef DEBUG
, mPRThread(nullptr)
#endif
@ -4097,6 +4097,7 @@ WorkerPrivate::InitializeGCTimers()
mIdleGCTimerTarget = new TimerThreadEventTarget(this, runnable);
mPeriodicGCTimerRunning = false;
mIdleGCTimerRunning = false;
}
void
@ -4107,13 +4108,15 @@ WorkerPrivate::SetGCTimerMode(GCTimerMode aMode)
MOZ_ASSERT(mPeriodicGCTimerTarget);
MOZ_ASSERT(mIdleGCTimerTarget);
if (aMode == PeriodicTimer && mPeriodicGCTimerRunning) {
if ((aMode == PeriodicTimer && mPeriodicGCTimerRunning) ||
(aMode == IdleTimer && mIdleGCTimerRunning)) {
return;
}
MOZ_ALWAYS_TRUE(NS_SUCCEEDED(mGCTimer->Cancel()));
mPeriodicGCTimerRunning = false;
mIdleGCTimerRunning = false;
LOG(("Worker %p canceled GC timer because %s\n", this,
aMode == PeriodicTimer ?
@ -4152,6 +4155,7 @@ WorkerPrivate::SetGCTimerMode(GCTimerMode aMode)
}
else {
LOG(("Worker %p scheduled idle GC timer\n", this));
mIdleGCTimerRunning = true;
}
}
@ -4171,6 +4175,7 @@ WorkerPrivate::ShutdownGCTimers()
mPeriodicGCTimerTarget = nullptr;
mIdleGCTimerTarget = nullptr;
mPeriodicGCTimerRunning = false;
mIdleGCTimerRunning = false;
}
bool
@ -5706,12 +5711,6 @@ WorkerPrivate::ConnectMessagePort(JSContext* aCx, uint64_t aMessagePortSerial)
nsRefPtr<MessagePort> port = new MessagePort(this, aMessagePortSerial);
JS::Rooted<JS::Value> jsPort(aCx);
if (!WrapNewBindingObject(aCx, jsGlobal, port, &jsPort)) {
MOZ_ASSERT(JS_IsExceptionPending(aCx));
return false;
}
GlobalObject globalObject(aCx, jsGlobal);
if (globalObject.Failed()) {
return false;
@ -5720,7 +5719,7 @@ WorkerPrivate::ConnectMessagePort(JSContext* aCx, uint64_t aMessagePortSerial)
RootedDictionary<MessageEventInit> init(aCx);
init.mBubbles = false;
init.mCancelable = false;
init.mSource = &jsPort.toObject();
init.mSource.SetValue().SetAsMessagePort() = port;
ErrorResult rv;

Просмотреть файл

@ -736,6 +736,7 @@ class WorkerPrivate : public WorkerPrivateParent<WorkerPrivate>
bool mBlockedForMemoryReporter;
bool mCancelAllPendingRunnables;
bool mPeriodicGCTimerRunning;
bool mIdleGCTimerRunning;
#ifdef DEBUG
PRThread* mPRThread;

Просмотреть файл

@ -2045,12 +2045,11 @@ XMLHttpRequest::Send(const nsAString& aBody, ErrorResult& aRv)
}
void
XMLHttpRequest::Send(JSObject* aBody, ErrorResult& aRv)
XMLHttpRequest::Send(JS::Handle<JSObject*> aBody, ErrorResult& aRv)
{
JSContext* cx = mWorkerPrivate->GetJSContext();
MOZ_ASSERT(aBody);
JS::Rooted<JSObject*> body(cx, aBody);
mWorkerPrivate->AssertIsOnWorkerThread();
@ -2065,12 +2064,12 @@ XMLHttpRequest::Send(JSObject* aBody, ErrorResult& aRv)
}
JS::Rooted<JS::Value> valToClone(cx);
if (JS_IsArrayBufferObject(body) || JS_IsArrayBufferViewObject(body) ||
file::GetDOMBlobFromJSObject(body)) {
valToClone.setObject(*body);
if (JS_IsArrayBufferObject(aBody) || JS_IsArrayBufferViewObject(aBody) ||
file::GetDOMBlobFromJSObject(aBody)) {
valToClone.setObject(*aBody);
}
else {
JS::Rooted<JS::Value> obj(cx, JS::ObjectValue(*body));
JS::Rooted<JS::Value> obj(cx, JS::ObjectValue(*aBody));
JSString* bodyStr = JS::ToString(cx, obj);
if (!bodyStr) {
aRv.Throw(NS_ERROR_OUT_OF_MEMORY);
@ -2095,6 +2094,20 @@ XMLHttpRequest::Send(JSObject* aBody, ErrorResult& aRv)
SendInternal(EmptyString(), buffer, clonedObjects, aRv);
}
void
XMLHttpRequest::Send(const ArrayBuffer& aBody, ErrorResult& aRv)
{
JS::Rooted<JSObject*> obj(mWorkerPrivate->GetJSContext(), aBody.Obj());
return Send(obj, aRv);
}
void
XMLHttpRequest::Send(const ArrayBufferView& aBody, ErrorResult& aRv)
{
JS::Rooted<JSObject*> obj(mWorkerPrivate->GetJSContext(), aBody.Obj());
return Send(obj, aRv);
}
void
XMLHttpRequest::SendAsBinary(const nsAString& aBody, ErrorResult& aRv)
{

Просмотреть файл

@ -160,23 +160,13 @@ public:
Send(const nsAString& aBody, ErrorResult& aRv);
void
Send(JSObject* aBody, ErrorResult& aRv);
Send(JS::Handle<JSObject*> aBody, ErrorResult& aRv);
void
Send(JSObject& aBody, ErrorResult& aRv)
{
Send(&aBody, aRv);
}
Send(const ArrayBuffer& aBody, ErrorResult& aRv);
void
Send(const ArrayBuffer& aBody, ErrorResult& aRv) {
return Send(aBody.Obj(), aRv);
}
void
Send(const ArrayBufferView& aBody, ErrorResult& aRv) {
return Send(aBody.Obj(), aRv);
}
Send(const ArrayBufferView& aBody, ErrorResult& aRv);
void
SendAsBinary(const nsAString& aBody, ErrorResult& aRv);

Просмотреть файл

@ -16,6 +16,7 @@
#include "gfxPlatform.h" // for gfxPlatform, gfxImageFormat
#include "gfxRect.h" // for gfxRect
#include "gfxUtils.h" // for gfxUtils
#include "gfx2DGlue.h" // for thebes --> moz2d transition
#include "mozilla/gfx/BaseSize.h" // for BaseSize
#include "nsDebug.h" // for NS_ASSERTION, NS_WARNING, etc
#include "nsISupportsImpl.h" // for gfxContext::AddRef, etc
@ -105,7 +106,7 @@ CopyableCanvasLayer::UpdateSurface(gfxASurface* aDestSurface, Layer* aMaskLayer)
return;
}
gfxIntSize readSize(sharedSurf->Size());
IntSize readSize(ToIntSize(sharedSurf->Size()));
gfxImageFormat format = (GetContentFlags() & CONTENT_OPAQUE)
? gfxImageFormatRGB24
: gfxImageFormatARGB32;
@ -128,7 +129,7 @@ CopyableCanvasLayer::UpdateSurface(gfxASurface* aDestSurface, Layer* aMaskLayer)
SharedSurface_Basic* sharedSurf_Basic = SharedSurface_Basic::Cast(surfGL);
readSurf = sharedSurf_Basic->GetData();
} else {
if (resultSurf->GetSize() != readSize ||
if (ToIntSize(resultSurf->GetSize()) != readSize ||
!(readSurf = resultSurf->GetAsImageSurface()) ||
readSurf->Format() != format)
{
@ -213,14 +214,14 @@ CopyableCanvasLayer::PaintWithOpacity(gfxContext* aContext,
}
gfxImageSurface*
CopyableCanvasLayer::GetTempSurface(const gfxIntSize& aSize, const gfxImageFormat aFormat)
CopyableCanvasLayer::GetTempSurface(const IntSize& aSize, const gfxImageFormat aFormat)
{
if (!mCachedTempSurface ||
aSize.width != mCachedSize.width ||
aSize.height != mCachedSize.height ||
aFormat != mCachedFormat)
{
mCachedTempSurface = new gfxImageSurface(aSize, aFormat);
mCachedTempSurface = new gfxImageSurface(ThebesIntSize(aSize), aFormat);
mCachedSize = aSize;
mCachedFormat = aFormat;
}

Просмотреть файл

@ -13,7 +13,6 @@
#include "gfxContext.h" // for gfxContext, etc
#include "gfxTypes.h"
#include "gfxPlatform.h" // for gfxImageFormat
#include "gfxPoint.h" // for gfxIntSize
#include "mozilla/Assertions.h" // for MOZ_ASSERT, etc
#include "mozilla/Preferences.h" // for Preferences
#include "mozilla/RefPtr.h" // for RefPtr
@ -61,10 +60,10 @@ protected:
bool mForceReadback;
nsRefPtr<gfxImageSurface> mCachedTempSurface;
gfxIntSize mCachedSize;
gfx::IntSize mCachedSize;
gfxImageFormat mCachedFormat;
gfxImageSurface* GetTempSurface(const gfxIntSize& aSize, const gfxImageFormat aFormat);
gfxImageSurface* GetTempSurface(const gfx::IntSize& aSize, const gfxImageFormat aFormat);
void DiscardTempSurface();
};

Просмотреть файл

@ -110,12 +110,11 @@ GrallocImage::SetData(const Data& aData)
}
uint8_t* yChannel = static_cast<uint8_t*>(vaddr);
gfxIntSize ySize = gfxIntSize(aData.mYSize.width,
aData.mYSize.height);
gfx::IntSize ySize = aData.mYSize;
int32_t yStride = graphicBuffer->getStride();
uint8_t* vChannel = yChannel + (yStride * ySize.height);
gfxIntSize uvSize = gfxIntSize(ySize.width / 2,
gfx::IntSize uvSize = gfx::IntSize(ySize.width / 2,
ySize.height / 2);
// Align to 16 bytes boundary
int32_t uvStride = ((yStride / 2) + 15) & ~0x0F;

Просмотреть файл

@ -9,6 +9,7 @@
#ifdef MOZ_WIDGET_GONK
#include "mozilla/layers/LayersSurfaces.h"
#include "mozilla/gfx/Point.h"
#include "ImageLayers.h"
#include "ImageContainer.h"
@ -78,7 +79,7 @@ class GrallocImage : public PlanarYCbCrImage
public:
struct GrallocData {
nsRefPtr<GraphicBufferLocked> mGraphicBuffer;
gfxIntSize mPicSize;
gfx::IntSize mPicSize;
};
GrallocImage();

Просмотреть файл

@ -310,7 +310,9 @@ ImageContainer::LockCurrentAsSurface(gfx::IntSize *aSize, Image** aCurrentImage)
if (mActiveImage->GetFormat() == REMOTE_IMAGE_BITMAP) {
nsRefPtr<gfxImageSurface> newSurf =
new gfxImageSurface(mRemoteData->mBitmap.mData, mRemoteData->mSize, mRemoteData->mBitmap.mStride,
new gfxImageSurface(mRemoteData->mBitmap.mData,
ThebesIntSize(mRemoteData->mSize),
mRemoteData->mBitmap.mStride,
mRemoteData->mFormat == RemoteImageData::BGRX32 ?
gfxImageFormatARGB32 :
gfxImageFormatRGB24);
@ -380,7 +382,7 @@ ImageContainer::GetCurrentSize()
}
if (!mActiveImage) {
return gfxIntSize(0,0);
return gfx::IntSize(0,0);
}
return mActiveImage->GetSize();
@ -464,7 +466,7 @@ PlanarYCbCrImage::AllocateBuffer(uint32_t aSize)
static void
CopyPlane(uint8_t *aDst, const uint8_t *aSrc,
const gfxIntSize &aSize, int32_t aStride, int32_t aSkip)
const gfx::IntSize &aSize, int32_t aStride, int32_t aSkip)
{
if (!aSkip) {
// Fast path: planar input.
@ -581,7 +583,7 @@ already_AddRefed<gfxASurface>
RemoteBitmapImage::GetAsSurface()
{
nsRefPtr<gfxImageSurface> newSurf =
new gfxImageSurface(mSize,
new gfxImageSurface(ThebesIntSize(mSize),
mFormat == RemoteImageData::BGRX32 ? gfxImageFormatRGB24 : gfxImageFormatARGB32);
for (int y = 0; y < mSize.height; y++) {

Просмотреть файл

@ -10,7 +10,6 @@
#include <sys/types.h> // for int32_t
#include "ImageTypes.h" // for ImageFormat, etc
#include "gfxASurface.h" // for gfxASurface, etc
#include "gfxPoint.h" // for gfxIntSize
#include "mozilla/Assertions.h" // for MOZ_ASSERT_HELPER2
#include "mozilla/Mutex.h" // for Mutex
#include "mozilla/ReentrantMonitor.h" // for ReentrantMonitorAutoEnter, etc
@ -305,7 +304,7 @@ struct RemoteImageData {
bool mWasUpdated;
Type mType;
Format mFormat;
gfxIntSize mSize;
gfx::IntSize mSize;
union {
struct {
/* This pointer is set by a remote process, however it will be set to
@ -511,7 +510,7 @@ public:
* Can be called on any thread. This method takes mReentrantMonitor
* when accessing thread-shared state.
*/
void SetScaleHint(const gfxIntSize& aScaleHint)
void SetScaleHint(const gfx::IntSize& aScaleHint)
{ mScaleHint = aScaleHint; }
void SetImageFactory(ImageFactory *aFactory)
@ -638,7 +637,7 @@ protected:
// create images for this container.
nsRefPtr<ImageFactory> mImageFactory;
gfxIntSize mScaleHint;
gfx::IntSize mScaleHint;
nsRefPtr<BufferRecycleBin> mRecycleBin;
@ -706,19 +705,19 @@ struct PlanarYCbCrData {
// Luminance buffer
uint8_t* mYChannel;
int32_t mYStride;
gfxIntSize mYSize;
gfx::IntSize mYSize;
int32_t mYSkip;
// Chroma buffers
uint8_t* mCbChannel;
uint8_t* mCrChannel;
int32_t mCbCrStride;
gfxIntSize mCbCrSize;
gfx::IntSize mCbCrSize;
int32_t mCbSkip;
int32_t mCrSkip;
// Picture region
uint32_t mPicX;
uint32_t mPicY;
gfxIntSize mPicSize;
gfx::IntSize mPicSize;
StereoMode mStereoMode;
nsIntRect GetPictureRect() const {
@ -865,7 +864,7 @@ class CairoImage : public Image {
public:
struct Data {
gfxASurface* mSurface;
gfxIntSize mSize;
gfx::IntSize mSize;
};
/**
@ -891,7 +890,7 @@ public:
CairoImage() : Image(nullptr, CAIRO_SURFACE) {}
nsCountedRef<nsMainThreadSurfaceRef> mSurface;
gfxIntSize mSize;
gfx::IntSize mSize;
};
class RemoteBitmapImage : public Image {
@ -904,7 +903,7 @@ public:
unsigned char *mData;
int mStride;
gfxIntSize mSize;
gfx::IntSize mSize;
RemoteImageData::Format mFormat;
};

Просмотреть файл

@ -8,8 +8,8 @@
#include "Layers.h" // for Layer, etc
#include "GraphicsFilter.h" // for GraphicsFilter
#include "gfxPoint.h" // for gfxIntSize
#include "mozilla/gfx/BaseSize.h" // for BaseSize
#include "mozilla/gfx/Point.h" // for IntSize
#include "mozilla/layers/LayersTypes.h"
#include "nsAutoPtr.h" // for nsRefPtr
#include "nscore.h" // for nsACString
@ -50,7 +50,7 @@ public:
* CONSTRUCTION PHASE ONLY
* Set the size to scale the image to and the mode at which to scale.
*/
void SetScaleToSize(const gfxIntSize &aSize, ScaleMode aMode)
void SetScaleToSize(const gfx::IntSize &aSize, ScaleMode aMode)
{
if (mScaleToSize != aSize || mScaleMode != aMode) {
mScaleToSize = aSize;
@ -62,7 +62,7 @@ public:
ImageContainer* GetContainer() { return mContainer; }
GraphicsFilter GetFilter() { return mFilter; }
const gfxIntSize& GetScaleToSize() { return mScaleToSize; }
const gfx::IntSize& GetScaleToSize() { return mScaleToSize; }
ScaleMode GetScaleMode() { return mScaleMode; }
MOZ_LAYER_DECL_NAME("ImageLayer", TYPE_IMAGE)
@ -89,7 +89,7 @@ protected:
nsRefPtr<ImageContainer> mContainer;
GraphicsFilter mFilter;
gfxIntSize mScaleToSize;
gfx::IntSize mScaleToSize;
ScaleMode mScaleMode;
bool mDisallowBigImage;
};

Просмотреть файл

@ -11,11 +11,11 @@
#include "gfx3DMatrix.h" // for gfx3DMatrix
#include "gfxColor.h" // for gfxRGBA
#include "GraphicsFilter.h" // for GraphicsFilter
#include "gfxPoint.h" // for gfxIntSize
#include "gfxPoint3D.h" // for gfxPoint3D
#include "gfxRect.h" // for gfxRect
#include "gfxUtils.h" // for gfxUtils
#include "mozilla/gfx/BaseSize.h" // for BaseSize
#include "mozilla/gfx/Point.h" // for IntSize
#include "mozilla/mozalloc.h" // for operator new, etc
#include "nsAutoPtr.h" // for nsRefPtr, nsAutoPtr, etc
#include "nsDataHashtable.h" // for nsDataHashtable
@ -351,7 +351,7 @@ struct ImageLayerProperties : public LayerPropertiesBase
nsRefPtr<ImageContainer> mContainer;
GraphicsFilter mFilter;
gfxIntSize mScaleToSize;
gfx::IntSize mScaleToSize;
ScaleMode mScaleMode;
};

Просмотреть файл

@ -113,15 +113,15 @@ LayerManager::GetScrollableLayers(nsTArray<Layer*>& aArray)
}
already_AddRefed<gfxASurface>
LayerManager::CreateOptimalSurface(const gfxIntSize &aSize,
LayerManager::CreateOptimalSurface(const gfx::IntSize &aSize,
gfxImageFormat aFormat)
{
return gfxPlatform::GetPlatform()->
CreateOffscreenSurface(aSize, gfxASurface::ContentFromFormat(aFormat));
CreateOffscreenSurface(gfx::ThebesIntSize(aSize), gfxASurface::ContentFromFormat(aFormat));
}
already_AddRefed<gfxASurface>
LayerManager::CreateOptimalMaskSurface(const gfxIntSize &aSize)
LayerManager::CreateOptimalMaskSurface(const gfx::IntSize &aSize)
{
return CreateOptimalSurface(aSize, gfxImageFormatA8);
}

Просмотреть файл

@ -17,7 +17,7 @@
#include "gfxColor.h" // for gfxRGBA
#include "gfxMatrix.h" // for gfxMatrix
#include "GraphicsFilter.h" // for GraphicsFilter
#include "gfxPoint.h" // for gfxPoint, gfxIntSize
#include "gfxPoint.h" // for gfxPoint
#include "gfxRect.h" // for gfxRect
#include "mozilla/Assertions.h" // for MOZ_ASSERT_HELPER2, etc
#include "mozilla/DebugOnly.h" // for DebugOnly
@ -423,7 +423,7 @@ public:
* manager.
*/
virtual already_AddRefed<gfxASurface>
CreateOptimalSurface(const gfxIntSize &aSize,
CreateOptimalSurface(const gfx::IntSize &aSize,
gfxImageFormat imageFormat);
/**
@ -433,7 +433,7 @@ public:
* is fairly simple.
*/
virtual already_AddRefed<gfxASurface>
CreateOptimalMaskSurface(const gfxIntSize &aSize);
CreateOptimalMaskSurface(const gfx::IntSize &aSize);
/**
* Creates a DrawTarget for use with canvas which is optimized for
@ -443,7 +443,7 @@ public:
CreateDrawTarget(const mozilla::gfx::IntSize &aSize,
mozilla::gfx::SurfaceFormat aFormat);
virtual bool CanUseCanvasLayerForSize(const gfxIntSize &aSize) { return true; }
virtual bool CanUseCanvasLayerForSize(const gfx::IntSize &aSize) { return true; }
/**
* returns the maximum texture size on this layer backend, or INT32_MAX

Просмотреть файл

@ -23,7 +23,7 @@ public:
MacIOSurface* GetSurface() { return mSurface; }
gfx::IntSize GetSize() {
return gfxIntSize(mSurface->GetDevicePixelWidth(), mSurface->GetDevicePixelHeight());
return gfx::IntSize(mSurface->GetDevicePixelWidth(), mSurface->GetDevicePixelHeight());
}
virtual ISharedImage* AsSharedImage() MOZ_OVERRIDE { return this; }

Просмотреть файл

@ -9,7 +9,6 @@
#include "GLContextProvider.h" // for GLContextProvider
#include "ImageContainer.h" // for Image
#include "ImageTypes.h" // for ImageFormat::SHARED_TEXTURE
#include "gfxPoint.h" // for gfxIntSize
#include "nsCOMPtr.h" // for already_AddRefed
#include "mozilla/gfx/Point.h" // for IntSize

Просмотреть файл

@ -95,16 +95,16 @@ uint32_t YCbCrImageDataDeserializerBase::GetCbCrStride()
return info->mCbCrWidth;
}
gfxIntSize YCbCrImageDataDeserializerBase::GetYSize()
gfx::IntSize YCbCrImageDataDeserializerBase::GetYSize()
{
YCbCrBufferInfo* info = GetYCbCrBufferInfo(mData);
return gfxIntSize(info->mYWidth, info->mYHeight);
return gfx::IntSize(info->mYWidth, info->mYHeight);
}
gfxIntSize YCbCrImageDataDeserializerBase::GetCbCrSize()
gfx::IntSize YCbCrImageDataDeserializerBase::GetCbCrSize()
{
YCbCrBufferInfo* info = GetYCbCrBufferInfo(mData);
return gfxIntSize(info->mCbCrWidth, info->mCbCrHeight);
return gfx::IntSize(info->mCbCrWidth, info->mCbCrHeight);
}
StereoMode YCbCrImageDataDeserializerBase::GetStereoMode()
@ -132,13 +132,6 @@ YCbCrImageDataSerializer::ComputeMinBufferSize(const gfx::IntSize& aYSize,
+ MOZ_ALIGN_WORD(sizeof(YCbCrBufferInfo));
}
size_t
YCbCrImageDataSerializer::ComputeMinBufferSize(const gfxIntSize& aYSize,
const gfxIntSize& aCbCrSize)
{
return ComputeMinBufferSize(gfx::IntSize(aYSize.width, aYSize.height),
gfx::IntSize(aCbCrSize.width, aCbCrSize.height));
}
// Offset in bytes
static size_t ComputeOffset(uint32_t aSize)
{
@ -183,16 +176,6 @@ YCbCrImageDataSerializer::InitializeBufferInfo(const gfx::IntSize& aYSize,
return InitializeBufferInfo(yOffset, cbOffset, crOffset, aYSize, aCbCrSize, aStereoMode);
}
void
YCbCrImageDataSerializer::InitializeBufferInfo(const gfxIntSize& aYSize,
const gfxIntSize& aCbCrSize,
StereoMode aStereoMode)
{
InitializeBufferInfo(gfx::IntSize(aYSize.width, aYSize.height),
gfx::IntSize(aCbCrSize.width, aCbCrSize.height),
aStereoMode);
}
static void CopyLineWithSkip(const uint8_t* src, uint8_t* dst, uint32_t len, uint32_t skip) {
for (uint32_t i = 0; i < len; ++i) {
*dst = *src;
@ -204,8 +187,8 @@ static void CopyLineWithSkip(const uint8_t* src, uint8_t* dst, uint32_t len, uin
bool
YCbCrImageDataSerializer::CopyData(const uint8_t* aYData,
const uint8_t* aCbData, const uint8_t* aCrData,
gfxIntSize aYSize, uint32_t aYStride,
gfxIntSize aCbCrSize, uint32_t aCbCrStride,
gfx::IntSize aYSize, uint32_t aYStride,
gfx::IntSize aCbCrSize, uint32_t aCbCrStride,
uint32_t aYSkip, uint32_t aCbCrSkip)
{
if (!IsValid() || GetYSize() != aYSize || GetCbCrSize() != aCbCrSize) {
@ -250,7 +233,7 @@ TemporaryRef<gfx::DataSourceSurface>
YCbCrImageDataDeserializer::ToDataSourceSurface()
{
RefPtr<gfx::DataSourceSurface> result =
gfx::Factory::CreateDataSourceSurface(ToIntSize(GetYSize()), gfx::FORMAT_R8G8B8X8);
gfx::Factory::CreateDataSourceSurface(GetYSize(), gfx::FORMAT_R8G8B8X8);
gfx::ConvertYCbCrToRGB32(GetYData(), GetCbData(), GetCrData(),
result->GetData(),

Просмотреть файл

@ -9,7 +9,6 @@
#include <stddef.h> // for size_t
#include <stdint.h> // for uint8_t, uint32_t
#include "ImageTypes.h" // for StereoMode
#include "gfxPoint.h" // for gfxIntSize
#include "mozilla/Attributes.h" // for MOZ_STACK_CLASS
#include "mozilla/RefPtr.h" // for TemporaryRef
#include "mozilla/gfx/Point.h" // for IntSize
@ -58,12 +57,12 @@ public:
/**
* Returns the dimensions of the Y Channel.
*/
gfxIntSize GetYSize();
gfx::IntSize GetYSize();
/**
* Returns the dimensions of the Cb and Cr Channel.
*/
gfxIntSize GetCbCrSize();
gfx::IntSize GetCbCrSize();
/**
* Stereo mode for the image.
@ -105,8 +104,6 @@ public:
*/
static size_t ComputeMinBufferSize(const gfx::IntSize& aYSize,
const gfx::IntSize& aCbCrSize);
static size_t ComputeMinBufferSize(const gfxIntSize& aYSize,
const gfxIntSize& aCbCrSize);
static size_t ComputeMinBufferSize(uint32_t aSize);
/**
@ -123,14 +120,10 @@ public:
void InitializeBufferInfo(const gfx::IntSize& aYSize,
const gfx::IntSize& aCbCrSize,
StereoMode aStereoMode);
void InitializeBufferInfo(const gfxIntSize& aYSize,
const gfxIntSize& aCbCrSize,
StereoMode aStereoMode);
bool CopyData(const uint8_t* aYData,
const uint8_t* aCbData, const uint8_t* aCrData,
gfxIntSize aYSize, uint32_t aYStride,
gfxIntSize aCbCrSize, uint32_t aCbCrStride,
gfx::IntSize aYSize, uint32_t aYStride,
gfx::IntSize aCbCrSize, uint32_t aCbCrStride,
uint32_t aYSkip, uint32_t aCbCrSkip);
};

Просмотреть файл

@ -27,6 +27,7 @@
#include "gfxPoint.h" // for gfxIntSize, gfxPoint
#include "gfxRect.h" // for gfxRect
#include "gfxUtils.h" // for gfxUtils
#include "gfx2DGlue.h" // for thebes --> moz2d transition
#include "mozilla/Assertions.h" // for MOZ_ASSERT, etc
#include "mozilla/WidgetUtils.h" // for ScreenRotation
#include "mozilla/gfx/2D.h" // for DrawTarget
@ -721,7 +722,7 @@ PixmanTransform(const gfxImageSurface* aDest,
const gfx3DMatrix& aTransform,
gfxPoint aDestOffset)
{
gfxIntSize destSize = aDest->GetSize();
IntSize destSize = ToIntSize(aDest->GetSize());
pixman_image_t* dest = pixman_image_create_bits(aDest->Format() == gfxImageFormatARGB32 ? PIXMAN_a8r8g8b8 : PIXMAN_x8r8g8b8,
destSize.width,
destSize.height,

Просмотреть файл

@ -6,6 +6,7 @@
#include "mozilla/layers/TextureClient.h"
#include <stdint.h> // for uint8_t, uint32_t, etc
#include "Layers.h" // for Layer, etc
#include "gfx2DGlue.h"
#include "gfxContext.h" // for gfxContext, etc
#include "gfxPlatform.h" // for gfxPlatform
#include "gfxPoint.h" // for gfxIntSize, gfxSize
@ -51,12 +52,14 @@ namespace layers {
* deallocte or recycle the it.
*/
class TextureChild : public PTextureChild
, public AtomicRefCounted<TextureChild>
{
public:
TextureChild()
: mForwarder(nullptr)
, mTextureData(nullptr)
, mTextureClient(nullptr)
, mIPCOpen(false)
{
MOZ_COUNT_CTOR(TextureChild);
}
@ -86,11 +89,29 @@ public:
void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE;
bool IPCOpen() const { return mIPCOpen; }
private:
// AddIPDLReference and ReleaseIPDLReference are only to be called by CreateIPDLActor
// and DestroyIPDLActor, respectively. We intentionally make them private to prevent misuse.
// The purpose of these methods is to be aware of when the IPC system around this
// actor goes down: mIPCOpen is then set to false.
void AddIPDLReference() {
MOZ_ASSERT(mIPCOpen == false);
mIPCOpen = true;
AddRef();
}
void ReleaseIPDLReference() {
MOZ_ASSERT(mIPCOpen == true);
mIPCOpen = false;
Release();
}
CompositableForwarder* mForwarder;
TextureClientData* mTextureData;
TextureClient* mTextureClient;
bool mIPCOpen;
friend class TextureClient;
};
@ -124,14 +145,16 @@ TextureChild::ActorDestroy(ActorDestroyReason why)
PTextureChild*
TextureClient::CreateIPDLActor()
{
return new TextureChild();
TextureChild* c = new TextureChild();
c->AddIPDLReference();
return c;
}
// static
bool
TextureClient::DestroyIPDLActor(PTextureChild* actor)
{
delete actor;
static_cast<TextureChild*>(actor)->ReleaseIPDLReference();
return true;
}
@ -150,7 +173,8 @@ TextureClient::InitIPDLActor(CompositableForwarder* aForwarder)
mActor->mForwarder = aForwarder;
mActor->mTextureClient = this;
mShared = true;
return mActor->SendInit(desc, GetFlags());
return mActor->IPCOpen() &&
mActor->SendInit(desc, GetFlags());
}
PTextureChild*
@ -233,8 +257,7 @@ ShmemTextureClient::DropTextureData()
}
TextureClient::TextureClient(TextureFlags aFlags)
: mActor(nullptr)
, mFlags(aFlags)
: mFlags(aFlags)
, mShared(false)
, mValid(true)
{}
@ -250,10 +273,14 @@ void TextureClient::ForceRemove()
if (mValid && mActor) {
if (GetFlags() & TEXTURE_DEALLOCATE_CLIENT) {
mActor->SetTextureData(DropTextureData());
mActor->SendRemoveTextureSync();
if (mActor->IPCOpen()) {
mActor->SendRemoveTextureSync();
}
mActor->DeleteTextureData();
} else {
mActor->SendRemoveTexture();
if (mActor->IPCOpen()) {
mActor->SendRemoveTexture();
}
}
}
MarkInvalid();
@ -506,8 +533,8 @@ BufferTextureClient::UpdateYCbCr(const PlanarYCbCrData& aData)
YCbCrImageDataSerializer serializer(GetBuffer());
MOZ_ASSERT(serializer.IsValid());
if (!serializer.CopyData(aData.mYChannel, aData.mCbChannel, aData.mCrChannel,
aData.mYSize, aData.mYStride,
aData.mCbCrSize, aData.mCbCrStride,
ThebesIntSize(aData.mYSize), aData.mYStride,
ThebesIntSize(aData.mCbCrSize), aData.mCbCrStride,
aData.mYSkip, aData.mCbSkip)) {
NS_WARNING("Failed to copy image data!");
return false;
@ -858,8 +885,8 @@ AutoLockYCbCrClient::Update(PlanarYCbCrImage* aImage)
YCbCrImageDataSerializer serializer(shmem.get<uint8_t>());
if (!serializer.CopyData(data->mYChannel, data->mCbChannel, data->mCrChannel,
data->mYSize, data->mYStride,
data->mCbCrSize, data->mCbCrStride,
ThebesIntSize(data->mYSize), data->mYStride,
ThebesIntSize(data->mCbCrSize), data->mCbCrStride,
data->mYSkip, data->mCbSkip)) {
NS_WARNING("Failed to copy image data!");
return false;

Просмотреть файл

@ -277,7 +277,7 @@ protected:
mFlags |= aFlags;
}
TextureChild* mActor;
RefPtr<TextureChild> mActor;
TextureFlags mFlags;
bool mShared;
bool mValid;

Просмотреть файл

@ -6,7 +6,7 @@
#include "mozilla/layers/ContentHost.h"
#include "LayersLogging.h" // for AppendToString
#include "gfx2DGlue.h" // for ContentForFormat
#include "gfxPoint.h" // for gfxIntSize
#include "mozilla/gfx/Point.h" // for IntSize
#include "mozilla/Assertions.h" // for MOZ_ASSERT, etc
#include "mozilla/gfx/BaseRect.h" // for BaseRect
#include "mozilla/layers/Compositor.h" // for Compositor
@ -523,7 +523,7 @@ ContentHostSingleBuffered::UpdateThebes(const ThebesBufferData& aData,
// Correct for rotation
destRegion.MoveBy(aData.rotation());
gfxIntSize size = aData.rect().Size();
IntSize size = aData.rect().Size();
nsIntRect destBounds = destRegion.GetBounds();
destRegion.MoveBy((destBounds.x >= size.width) ? -size.width : 0,
(destBounds.y >= size.height) ? -size.height : 0);
@ -620,7 +620,7 @@ DeprecatedContentHostSingleBuffered::UpdateThebes(const ThebesBufferData& aData,
// Correct for rotation
destRegion.MoveBy(aData.rotation());
gfxIntSize size = aData.rect().Size();
IntSize size = aData.rect().Size();
nsIntRect destBounds = destRegion.GetBounds();
destRegion.MoveBy((destBounds.x >= size.width) ? -size.width : 0,
(destBounds.y >= size.height) ? -size.height : 0);

Просмотреть файл

@ -25,7 +25,6 @@
#ifdef XP_MACOSX
#include "gfxPlatformMac.h"
#endif
#include "gfxPoint.h" // for gfxIntSize
#include "gfxRect.h" // for gfxRect
#include "mozilla/Assertions.h" // for MOZ_ASSERT, etc
#include "mozilla/RefPtr.h" // for RefPtr, TemporaryRef
@ -252,7 +251,7 @@ LayerManagerComposite::EndTransaction(DrawThebesLayerCallback aCallback,
}
already_AddRefed<gfxASurface>
LayerManagerComposite::CreateOptimalMaskSurface(const gfxIntSize &aSize)
LayerManagerComposite::CreateOptimalMaskSurface(const IntSize &aSize)
{
NS_RUNTIMEABORT("Should only be called on the drawing side");
return nullptr;
@ -786,7 +785,7 @@ LayerComposite::Destroy()
}
bool
LayerManagerComposite::CanUseCanvasLayerForSize(const gfxIntSize &aSize)
LayerManagerComposite::CanUseCanvasLayerForSize(const IntSize &aSize)
{
return mCompositor->CanUseCanvasLayerForSize(gfx::IntSize(aSize.width,
aSize.height));

Просмотреть файл

@ -11,7 +11,6 @@
#include "Layers.h"
#include "gfx3DMatrix.h" // for gfx3DMatrix
#include "gfxMatrix.h" // for gfxMatrix
#include "gfxPoint.h" // for gfxIntSize
#include "mozilla/Assertions.h" // for MOZ_ASSERT, etc
#include "mozilla/Attributes.h" // for MOZ_OVERRIDE
#include "mozilla/RefPtr.h" // for RefPtr, TemporaryRef
@ -118,7 +117,7 @@ public:
// XXX[nrc]: never called, we should move this logic to ClientLayerManager
// (bug 946926).
virtual bool CanUseCanvasLayerForSize(const gfxIntSize &aSize) MOZ_OVERRIDE;
virtual bool CanUseCanvasLayerForSize(const gfx::IntSize &aSize) MOZ_OVERRIDE;
virtual int32_t GetMaxTextureSize() const MOZ_OVERRIDE
{
@ -149,7 +148,7 @@ public:
}
virtual already_AddRefed<gfxASurface>
CreateOptimalMaskSurface(const gfxIntSize &aSize) MOZ_OVERRIDE;
CreateOptimalMaskSurface(const gfx::IntSize &aSize) MOZ_OVERRIDE;
virtual const char* Name() const MOZ_OVERRIDE { return ""; }

Просмотреть файл

@ -495,17 +495,17 @@ BufferTextureHost::Upload(nsIntRegion *aRegion)
RefPtr<gfx::DataSourceSurface> tempY =
gfx::Factory::CreateWrappingDataSourceSurface(yuvDeserializer.GetYData(),
yuvDeserializer.GetYStride(),
gfx::ToIntSize(yuvDeserializer.GetYSize()),
yuvDeserializer.GetYSize(),
gfx::FORMAT_A8);
RefPtr<gfx::DataSourceSurface> tempCb =
gfx::Factory::CreateWrappingDataSourceSurface(yuvDeserializer.GetCbData(),
yuvDeserializer.GetCbCrStride(),
gfx::ToIntSize(yuvDeserializer.GetCbCrSize()),
yuvDeserializer.GetCbCrSize(),
gfx::FORMAT_A8);
RefPtr<gfx::DataSourceSurface> tempCr =
gfx::Factory::CreateWrappingDataSourceSurface(yuvDeserializer.GetCrData(),
yuvDeserializer.GetCbCrStride(),
gfx::ToIntSize(yuvDeserializer.GetCbCrSize()),
yuvDeserializer.GetCbCrSize(),
gfx::FORMAT_A8);
// We don't support partial updates for Y U V textures
NS_ASSERTION(!aRegion, "Unsupported partial updates for YCbCr textures");

Просмотреть файл

@ -786,18 +786,17 @@ public:
AutoLockTextureHost(TextureHost* aTexture)
: mTexture(aTexture)
{
MOZ_ASSERT(mTexture);
mLocked = aTexture->Lock();
mLocked = mTexture ? mTexture->Lock() : false;
}
~AutoLockTextureHost()
{
if (mLocked) {
if (mTexture && mLocked) {
mTexture->Unlock();
}
}
bool Failed() { return !mLocked; }
bool Failed() { return mTexture && !mLocked; }
private:
RefPtr<TextureHost> mTexture;

Просмотреть файл

@ -24,7 +24,7 @@ static already_AddRefed<ID3D10Texture2D>
DataToTexture(ID3D10Device *aDevice,
unsigned char *data,
int stride,
const gfxIntSize &aSize)
const IntSize &aSize)
{
D3D10_SUBRESOURCE_DATA srdata;
@ -51,7 +51,7 @@ DataToTexture(ID3D10Device *aDevice,
static already_AddRefed<ID3D10Texture2D>
SurfaceToTexture(ID3D10Device *aDevice,
gfxASurface *aSurface,
const gfxIntSize &aSize)
const IntSize &aSize)
{
if (!aSurface) {
return nullptr;
@ -72,7 +72,7 @@ SurfaceToTexture(ID3D10Device *aDevice,
nsRefPtr<gfxImageSurface> imageSurface = aSurface->GetAsImageSurface();
if (!imageSurface) {
imageSurface = new gfxImageSurface(aSize,
imageSurface = new gfxImageSurface(ThebesIntSize(aSize),
gfxImageFormatARGB32);
nsRefPtr<gfxContext> context = new gfxContext(imageSurface);
@ -397,7 +397,7 @@ void ImageLayerD3D10::AllocateTexturesYCbCr(PlanarYCbCrImage *aImage)
}
already_AddRefed<ID3D10ShaderResourceView>
ImageLayerD3D10::GetAsTexture(gfxIntSize* aSize)
ImageLayerD3D10::GetAsTexture(gfx::IntSize* aSize)
{
if (!GetContainer()) {
return nullptr;

Просмотреть файл

@ -34,7 +34,7 @@ public:
void AllocateTexturesYCbCr(PlanarYCbCrImage *aImage);
virtual already_AddRefed<ID3D10ShaderResourceView> GetAsTexture(gfxIntSize* aSize);
virtual already_AddRefed<ID3D10ShaderResourceView> GetAsTexture(gfx::IntSize* aSize);
private:
ID3D10ShaderResourceView* GetImageSRView(Image* aImage, bool& aHasAlpha, IDXGIKeyedMutex **aMutex = nullptr);

Просмотреть файл

@ -8,6 +8,7 @@
#include "LayerManagerD3D10.h"
#include "LayerManagerD3D10Effect.h"
#include "gfxWindowsPlatform.h"
#include "gfx2DGlue.h"
#include "gfxD2DSurface.h"
#include "gfxFailure.h"
#include "cairo-win32.h"
@ -450,8 +451,8 @@ static void ReleaseTexture(void *texture)
}
already_AddRefed<gfxASurface>
LayerManagerD3D10::CreateOptimalSurface(const gfxIntSize &aSize,
gfxImageFormat aFormat)
LayerManagerD3D10::CreateOptimalSurface(const IntSize &aSize,
gfxImageFormat aFormat)
{
if ((aFormat != gfxImageFormatRGB24 &&
aFormat != gfxImageFormatARGB32)) {
@ -488,7 +489,7 @@ LayerManagerD3D10::CreateOptimalSurface(const gfxIntSize &aSize,
already_AddRefed<gfxASurface>
LayerManagerD3D10::CreateOptimalMaskSurface(const gfxIntSize &aSize)
LayerManagerD3D10::CreateOptimalMaskSurface(const IntSize &aSize)
{
return CreateOptimalSurface(aSize, gfxImageFormatARGB32);
}
@ -850,7 +851,7 @@ uint8_t
LayerD3D10::LoadMaskTexture()
{
if (Layer* maskLayer = GetLayer()->GetMaskLayer()) {
gfxIntSize size;
IntSize size;
nsRefPtr<ID3D10ShaderResourceView> maskSRV =
static_cast<LayerD3D10*>(maskLayer->ImplData())->GetAsTexture(&size);
@ -861,7 +862,7 @@ LayerD3D10::LoadMaskTexture()
gfxMatrix maskTransform;
bool maskIs2D = maskLayer->GetEffectiveTransform().CanDraw2D(&maskTransform);
NS_ASSERTION(maskIs2D, "How did we end up with a 3D transform here?!");
gfxRect bounds = gfxRect(gfxPoint(), size);
gfxRect bounds = gfxRect(gfxPoint(), ThebesIntSize(size));
bounds = maskTransform.TransformBounds(bounds);
effect()->GetVariableByName("vMaskQuad")->AsVector()->SetFloatVector(

Просмотреть файл

@ -92,9 +92,9 @@ public:
enum {
MAX_TEXTURE_SIZE = 8192
};
virtual bool CanUseCanvasLayerForSize(const gfxIntSize &aSize)
virtual bool CanUseCanvasLayerForSize(const gfx::IntSize &aSize)
{
return aSize <= gfxIntSize(MAX_TEXTURE_SIZE, MAX_TEXTURE_SIZE);
return aSize <= gfx::IntSize(MAX_TEXTURE_SIZE, MAX_TEXTURE_SIZE);
}
virtual int32_t GetMaxTextureSize() const
@ -110,14 +110,14 @@ public:
virtual already_AddRefed<ReadbackLayer> CreateReadbackLayer();
virtual already_AddRefed<gfxASurface>
CreateOptimalSurface(const gfxIntSize &aSize,
CreateOptimalSurface(const gfx::IntSize &aSize,
gfxImageFormat imageFormat);
virtual already_AddRefed<gfxASurface>
CreateOptimalMaskSurface(const gfxIntSize &aSize);
CreateOptimalMaskSurface(const gfx::IntSize &aSize);
virtual TemporaryRef<mozilla::gfx::DrawTarget>
CreateDrawTarget(const mozilla::gfx::IntSize &aSize,
CreateDrawTarget(const gfx::IntSize &aSize,
mozilla::gfx::SurfaceFormat aFormat);
virtual LayersBackend GetBackendType() { return LAYERS_D3D10; }
@ -230,7 +230,7 @@ public:
* Any layer that can be used as a mask layer should override this method.
* If aSize is non-null, it will contain the size of the texture.
*/
virtual already_AddRefed<ID3D10ShaderResourceView> GetAsTexture(gfxIntSize* aSize)
virtual already_AddRefed<ID3D10ShaderResourceView> GetAsTexture(gfx::IntSize* aSize)
{
return nullptr;
}

Просмотреть файл

@ -200,7 +200,7 @@ ThebesLayerD3D10::Validate(ReadbackProcessor *aReadback)
// No point in retaining parts which were not valid.
retainRegion.And(retainRegion, mValidRegion);
CreateNewTextures(gfxIntSize(newTextureRect.width, newTextureRect.height), mode);
CreateNewTextures(gfx::IntSize(newTextureRect.width, newTextureRect.height), mode);
nsIntRect largeRect = retainRegion.GetLargestRectangle();
@ -227,7 +227,7 @@ ThebesLayerD3D10::Validate(ReadbackProcessor *aReadback)
mTextureRect = newTextureRect;
if (!mTexture || (mode == SURFACE_COMPONENT_ALPHA && !mTextureOnWhite)) {
CreateNewTextures(gfxIntSize(newTextureRect.width, newTextureRect.height), mode);
CreateNewTextures(gfx::IntSize(newTextureRect.width, newTextureRect.height), mode);
mValidRegion.SetEmpty();
}
@ -433,7 +433,7 @@ ThebesLayerD3D10::DrawRegion(nsIntRegion &aRegion, SurfaceMode aMode)
}
void
ThebesLayerD3D10::CreateNewTextures(const gfxIntSize &aSize, SurfaceMode aMode)
ThebesLayerD3D10::CreateNewTextures(const gfx::IntSize &aSize, SurfaceMode aMode)
{
if (aSize.width == 0 || aSize.height == 0) {
// Nothing to do.

Просмотреть файл

@ -63,7 +63,7 @@ private:
void DrawRegion(nsIntRegion &aRegion, SurfaceMode aMode);
/* Create a new texture */
void CreateNewTextures(const gfxIntSize &aSize, SurfaceMode aMode);
void CreateNewTextures(const gfx::IntSize &aSize, SurfaceMode aMode);
// Fill textures with opaque black and white in the specified region.
void FillTexturesBlackWhite(const nsIntRegion& aRegion, const nsIntPoint& aOffset);

Просмотреть файл

@ -12,6 +12,7 @@
#include "mozilla/layers/YCbCrImageDataSerializer.h"
#include "gfxWindowsPlatform.h"
#include "gfxD2DSurface.h"
#include "gfx2DGlue.h"
namespace mozilla {
@ -313,7 +314,7 @@ DeprecatedTextureHostShmemD3D11::UpdateImpl(const SurfaceDescriptor& aImage,
nsRefPtr<gfxImageSurface> surf = openSurf.GetAsImage();
gfxIntSize size = surf->GetSize();
gfx::IntSize size = gfx::ToIntSize(surf->GetSize());
uint32_t bpp = 0;
@ -338,7 +339,7 @@ DeprecatedTextureHostShmemD3D11::UpdateImpl(const SurfaceDescriptor& aImage,
NS_ERROR("Bad image format");
}
mSize = IntSize(size.width, size.height);
mSize = size;
CD3D11_TEXTURE2D_DESC desc(dxgiFormat, size.width, size.height,
1, 1, D3D11_BIND_SHADER_RESOURCE,
@ -488,9 +489,9 @@ DeprecatedTextureHostYCbCrD3D11::UpdateImpl(const SurfaceDescriptor& aImage,
YCbCrImageDataDeserializer yuvDeserializer(aImage.get_YCbCrImage().data().get<uint8_t>());
gfxIntSize gfxCbCrSize = yuvDeserializer.GetCbCrSize();
gfx::IntSize gfxCbCrSize = yuvDeserializer.GetCbCrSize();
gfxIntSize size = yuvDeserializer.GetYSize();
gfx::IntSize size = yuvDeserializer.GetYSize();
D3D11_SUBRESOURCE_DATA initData;
initData.pSysMem = yuvDeserializer.GetYData();

Просмотреть файл

@ -12,12 +12,13 @@
#include "Nv3DVUtils.h"
#include "plstr.h"
#include <algorithm>
#include "gfx2DGlue.h"
#include "gfxPlatform.h"
#include "gfxWindowsPlatform.h"
#include "TextureD3D9.h"
#include "mozilla/gfx/Point.h"
using mozilla::gfx::IntSize;
using namespace mozilla::gfx;
namespace mozilla {
namespace layers {
@ -548,7 +549,7 @@ bool
LoadMaskTexture(Layer* aMask, IDirect3DDevice9* aDevice,
uint32_t aMaskTexRegister)
{
gfxIntSize size;
gfx::IntSize size;
nsRefPtr<IDirect3DTexture9> texture =
static_cast<LayerD3D9*>(aMask->ImplData())->GetAsTexture(&size);
@ -559,7 +560,7 @@ LoadMaskTexture(Layer* aMask, IDirect3DDevice9* aDevice,
gfxMatrix maskTransform;
bool maskIs2D = aMask->GetEffectiveTransform().CanDraw2D(&maskTransform);
NS_ASSERTION(maskIs2D, "How did we end up with a 3D transform here?!");
gfxRect bounds = gfxRect(gfxPoint(), size);
gfxRect bounds = gfxRect(gfxPoint(), gfx::ThebesIntSize(size));
bounds = maskTransform.TransformBounds(bounds);
aDevice->SetVertexShaderConstantF(DeviceManagerD3D9::sMaskQuadRegister,

Просмотреть файл

@ -4,6 +4,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "ipc/AutoOpenSurface.h"
#include "mozilla/gfx/Point.h"
#include "mozilla/layers/PLayerTransaction.h"
#include "gfxSharedImageSurface.h"
@ -21,6 +22,8 @@
namespace mozilla {
namespace layers {
using namespace mozilla::gfx;
static inline _D3DFORMAT
D3dFormatForGfxFormat(gfxImageFormat aFormat)
{
@ -35,7 +38,7 @@ static already_AddRefed<IDirect3DTexture9>
DataToTexture(IDirect3DDevice9 *aDevice,
unsigned char *aData,
int aStride,
const gfxIntSize &aSize,
const IntSize &aSize,
_D3DFORMAT aFormat)
{
nsRefPtr<IDirect3DTexture9> texture;
@ -131,13 +134,13 @@ OpenSharedTexture(const D3DSURFACE_DESC& aDesc,
static already_AddRefed<IDirect3DTexture9>
SurfaceToTexture(IDirect3DDevice9 *aDevice,
gfxASurface *aSurface,
const gfxIntSize &aSize)
const IntSize &aSize)
{
nsRefPtr<gfxImageSurface> imageSurface = aSurface->GetAsImageSurface();
if (!imageSurface) {
imageSurface = new gfxImageSurface(aSize,
imageSurface = new gfxImageSurface(ThebesIntSize(aSize),
gfxImageFormatARGB32);
nsRefPtr<gfxContext> context = new gfxContext(imageSurface);
@ -545,7 +548,7 @@ ImageLayerD3D9::RenderLayer()
}
already_AddRefed<IDirect3DTexture9>
ImageLayerD3D9::GetAsTexture(gfxIntSize* aSize)
ImageLayerD3D9::GetAsTexture(gfx::IntSize* aSize)
{
if (!GetContainer()) {
return nullptr;

Просмотреть файл

@ -30,7 +30,7 @@ public:
virtual void RenderLayer();
virtual already_AddRefed<IDirect3DTexture9> GetAsTexture(gfxIntSize* aSize);
virtual already_AddRefed<IDirect3DTexture9> GetAsTexture(gfx::IntSize* aSize);
private:
IDirect3DTexture9* GetTexture(Image *aImage, bool& aHasAlpha);

Просмотреть файл

@ -78,12 +78,12 @@ public:
void SetRoot(Layer* aLayer);
virtual bool CanUseCanvasLayerForSize(const gfxIntSize &aSize)
virtual bool CanUseCanvasLayerForSize(const gfx::IntSize &aSize)
{
if (!mDeviceManager)
return false;
int32_t maxSize = mDeviceManager->GetMaxTextureSize();
return aSize <= gfxIntSize(maxSize, maxSize);
return aSize <= gfx::IntSize(maxSize, maxSize);
}
virtual int32_t GetMaxTextureSize() const
@ -248,7 +248,7 @@ public:
* If aSize is non-null and a texture is successfully returned, aSize will
* contain the size of the texture.
*/
virtual already_AddRefed<IDirect3DTexture9> GetAsTexture(gfxIntSize* aSize)
virtual already_AddRefed<IDirect3DTexture9> GetAsTexture(gfx::IntSize* aSize)
{
return nullptr;
}

Просмотреть файл

@ -378,8 +378,8 @@ DeprecatedTextureHostYCbCrD3D9::UpdateImpl(const SurfaceDescriptor& aImage,
YCbCrImageDataDeserializer yuvDeserializer(aImage.get_YCbCrImage().data().get<uint8_t>());
mSize = ToIntSize(yuvDeserializer.GetYSize());
IntSize cbCrSize = ToIntSize(yuvDeserializer.GetCbCrSize());
mSize = yuvDeserializer.GetYSize();
IntSize cbCrSize = yuvDeserializer.GetCbCrSize();
mStereoMode = yuvDeserializer.GetStereoMode();
DeviceManagerD3D9* deviceManager = gfxWindowsPlatform::GetPlatform()->GetD3D9DeviceManager();
@ -803,7 +803,7 @@ DeprecatedTextureClientDIB::EnsureAllocated(gfx::IntSize aSize,
gfxContentType aType)
{
if (mSurface) {
gfxIntSize size = mSurface->GetSize();
gfx::IntSize size = gfx::ToIntSize(mSurface->GetSize());
if (size.width == aSize.width &&
size.height == aSize.height) {
return true;

Просмотреть файл

@ -120,7 +120,7 @@ ThebesLayerD3D9::UpdateTextures(SurfaceMode aMode)
// the new visible region
retainRegion.And(mValidRegion, mVisibleRegion);
CreateNewTextures(gfxIntSize(visibleRect.width, visibleRect.height), aMode);
CreateNewTextures(gfx::IntSize(visibleRect.width, visibleRect.height), aMode);
// If our texture creation failed this can mean a device reset is pending and we
// should silently ignore the failure. In the future when device failures
@ -140,7 +140,7 @@ ThebesLayerD3D9::UpdateTextures(SurfaceMode aMode)
mTextureRect = visibleRect;
}
} else {
CreateNewTextures(gfxIntSize(visibleRect.width, visibleRect.height), aMode);
CreateNewTextures(gfx::IntSize(visibleRect.width, visibleRect.height), aMode);
mTextureRect = visibleRect;
NS_ASSERTION(mValidRegion.IsEmpty(), "Someone forgot to empty the region");
@ -598,8 +598,8 @@ ThebesLayerD3D9::DrawRegion(nsIntRegion &aRegion, SurfaceMode aMode,
}
void
ThebesLayerD3D9::CreateNewTextures(const gfxIntSize &aSize,
SurfaceMode aMode)
ThebesLayerD3D9::CreateNewTextures(const gfx::IntSize &aSize,
SurfaceMode aMode)
{
if (aSize.width == 0 || aSize.height == 0) {
// Nothing to do.

Просмотреть файл

@ -73,7 +73,7 @@ private:
const nsTArray<ReadbackProcessor::Update>& aReadbackUpdates);
/* Create a new texture */
void CreateNewTextures(const gfxIntSize &aSize, SurfaceMode aMode);
void CreateNewTextures(const gfx::IntSize &aSize, SurfaceMode aMode);
void CopyRegion(IDirect3DTexture9* aSrc, const nsIntPoint &aSrcOffset,
IDirect3DTexture9* aDest, const nsIntPoint &aDestOffset,

Просмотреть файл

@ -7,6 +7,7 @@
#include "ISurfaceAllocator.h"
#include <sys/types.h> // for int32_t
#include "gfx2DGlue.h" // for IntSize
#include "gfxASurface.h" // for gfxASurface, etc
#include "gfxPlatform.h" // for gfxPlatform, gfxImageFormat
#include "gfxSharedImageSurface.h" // for gfxSharedImageSurface
@ -42,7 +43,7 @@ IsSurfaceDescriptorValid(const SurfaceDescriptor& aSurface)
}
bool
ISurfaceAllocator::AllocSharedImageSurface(const gfxIntSize& aSize,
ISurfaceAllocator::AllocSharedImageSurface(const gfx::IntSize& aSize,
gfxContentType aContent,
gfxSharedImageSurface** aBuffer)
{
@ -50,7 +51,10 @@ ISurfaceAllocator::AllocSharedImageSurface(const gfxIntSize& aSize,
gfxImageFormat format = gfxPlatform::GetPlatform()->OptimalFormatForContent(aContent);
nsRefPtr<gfxSharedImageSurface> back =
gfxSharedImageSurface::CreateUnsafe(this, aSize, format, shmemType);
gfxSharedImageSurface::CreateUnsafe(this,
gfx::ThebesIntSize(aSize),
format,
shmemType);
if (!back)
return false;
@ -60,7 +64,7 @@ ISurfaceAllocator::AllocSharedImageSurface(const gfxIntSize& aSize,
}
bool
ISurfaceAllocator::AllocSurfaceDescriptor(const gfxIntSize& aSize,
ISurfaceAllocator::AllocSurfaceDescriptor(const gfx::IntSize& aSize,
gfxContentType aContent,
SurfaceDescriptor* aBuffer)
{
@ -68,7 +72,7 @@ ISurfaceAllocator::AllocSurfaceDescriptor(const gfxIntSize& aSize,
}
bool
ISurfaceAllocator::AllocSurfaceDescriptorWithCaps(const gfxIntSize& aSize,
ISurfaceAllocator::AllocSurfaceDescriptorWithCaps(const gfx::IntSize& aSize,
gfxContentType aContent,
uint32_t aCaps,
SurfaceDescriptor* aBuffer)
@ -162,7 +166,7 @@ ISurfaceAllocator::DestroySharedSurface(SurfaceDescriptor* aSurface)
#if !defined(MOZ_HAVE_PLATFORM_SPECIFIC_LAYER_BUFFERS)
bool
ISurfaceAllocator::PlatformAllocSurfaceDescriptor(const gfxIntSize&,
ISurfaceAllocator::PlatformAllocSurfaceDescriptor(const gfx::IntSize&,
gfxContentType,
uint32_t,
SurfaceDescriptor*)

Просмотреть файл

@ -9,7 +9,7 @@
#include <stddef.h> // for size_t
#include <stdint.h> // for uint32_t
#include "gfxTypes.h"
#include "gfxPoint.h" // for gfxIntSize
#include "mozilla/gfx/Point.h" // for IntSize
#include "mozilla/ipc/SharedMemory.h" // for SharedMemory, etc
#include "mozilla/RefPtr.h"
#include "nsIMemoryReporter.h" // for MemoryUniReporter
@ -100,15 +100,15 @@ public:
virtual void DeallocShmem(mozilla::ipc::Shmem& aShmem) = 0;
// was AllocBuffer
virtual bool AllocSharedImageSurface(const gfxIntSize& aSize,
virtual bool AllocSharedImageSurface(const gfx::IntSize& aSize,
gfxContentType aContent,
gfxSharedImageSurface** aBuffer);
virtual bool AllocSurfaceDescriptor(const gfxIntSize& aSize,
virtual bool AllocSurfaceDescriptor(const gfx::IntSize& aSize,
gfxContentType aContent,
SurfaceDescriptor* aBuffer);
// was AllocBufferWithCaps
virtual bool AllocSurfaceDescriptorWithCaps(const gfxIntSize& aSize,
virtual bool AllocSurfaceDescriptorWithCaps(const gfx::IntSize& aSize,
gfxContentType aContent,
uint32_t aCaps,
SurfaceDescriptor* aBuffer);
@ -116,7 +116,7 @@ public:
virtual void DestroySharedSurface(SurfaceDescriptor* aSurface);
// method that does the actual allocation work
virtual PGrallocBufferChild* AllocGrallocBuffer(const gfxIntSize& aSize,
virtual PGrallocBufferChild* AllocGrallocBuffer(const gfx::IntSize& aSize,
uint32_t aFormat,
uint32_t aUsage,
MaybeMagicGrallocBufferHandle* aHandle)
@ -134,7 +134,7 @@ protected:
// DeprecatedTextureClient/Host rework.
virtual bool IsOnCompositorSide() const = 0;
static bool PlatformDestroySharedSurface(SurfaceDescriptor* aSurface);
virtual bool PlatformAllocSurfaceDescriptor(const gfxIntSize& aSize,
virtual bool PlatformAllocSurfaceDescriptor(const gfx::IntSize& aSize,
gfxContentType aContent,
uint32_t aCaps,
SurfaceDescriptor* aBuffer);

Просмотреть файл

@ -22,6 +22,7 @@
#include "mozilla/ReentrantMonitor.h" // for ReentrantMonitor, etc
#include "mozilla/ipc/MessageChannel.h" // for MessageChannel, etc
#include "mozilla/ipc/Transport.h" // for Transport
#include "mozilla/gfx/Point.h" // for IntSize
#include "mozilla/layers/CompositableClient.h" // for CompositableChild, etc
#include "mozilla/layers/ISurfaceAllocator.h" // for ISurfaceAllocator
#include "mozilla/layers/ImageClient.h" // for ImageClient
@ -42,6 +43,7 @@ struct nsIntRect;
using namespace base;
using namespace mozilla::ipc;
using namespace mozilla::gfx;
namespace mozilla {
namespace ipc {
@ -212,12 +214,12 @@ static void CreateImageClientSync(RefPtr<ImageClient>* result,
struct GrallocParam {
gfxIntSize size;
IntSize size;
uint32_t format;
uint32_t usage;
SurfaceDescriptor* buffer;
GrallocParam(const gfxIntSize& aSize,
GrallocParam(const IntSize& aSize,
const uint32_t& aFormat,
const uint32_t& aUsage,
SurfaceDescriptor* aBuffer)
@ -647,7 +649,7 @@ ImageBridgeChild::CreateImageClientNow(CompositableType aType)
}
PGrallocBufferChild*
ImageBridgeChild::AllocPGrallocBufferChild(const gfxIntSize&, const uint32_t&, const uint32_t&,
ImageBridgeChild::AllocPGrallocBufferChild(const IntSize&, const uint32_t&, const uint32_t&,
MaybeMagicGrallocBufferHandle*)
{
#ifdef MOZ_HAVE_SURFACEDESCRIPTORGRALLOC
@ -671,7 +673,7 @@ ImageBridgeChild::DeallocPGrallocBufferChild(PGrallocBufferChild* actor)
}
bool
ImageBridgeChild::AllocSurfaceDescriptorGralloc(const gfxIntSize& aSize,
ImageBridgeChild::AllocSurfaceDescriptorGralloc(const IntSize& aSize,
const uint32_t& aFormat,
const uint32_t& aUsage,
SurfaceDescriptor* aBuffer)
@ -696,7 +698,7 @@ ImageBridgeChild::AllocSurfaceDescriptorGralloc(const gfxIntSize& aSize,
}
bool
ImageBridgeChild::AllocSurfaceDescriptorGrallocNow(const gfxIntSize& aSize,
ImageBridgeChild::AllocSurfaceDescriptorGrallocNow(const IntSize& aSize,
const uint32_t& aFormat,
const uint32_t& aUsage,
SurfaceDescriptor* aBuffer)
@ -878,7 +880,7 @@ ImageBridgeChild::DeallocShmem(ipc::Shmem& aShmem)
}
PGrallocBufferChild*
ImageBridgeChild::AllocGrallocBuffer(const gfxIntSize& aSize,
ImageBridgeChild::AllocGrallocBuffer(const IntSize& aSize,
uint32_t aFormat,
uint32_t aUsage,
MaybeMagicGrallocBufferHandle* aHandle)

Просмотреть файл

@ -8,7 +8,6 @@
#include <stddef.h> // for size_t
#include <stdint.h> // for uint32_t, uint64_t
#include "gfxPoint.h" // for gfxIntSize
#include "mozilla/Attributes.h" // for MOZ_OVERRIDE
#include "mozilla/RefPtr.h" // for TemporaryRef
#include "mozilla/ipc/SharedMemory.h" // for SharedMemory, etc
@ -189,7 +188,7 @@ public:
~ImageBridgeChild();
virtual PGrallocBufferChild*
AllocPGrallocBufferChild(const gfxIntSize&, const uint32_t&, const uint32_t&,
AllocPGrallocBufferChild(const gfx::IntSize&, const uint32_t&, const uint32_t&,
MaybeMagicGrallocBufferHandle*) MOZ_OVERRIDE;
virtual bool
@ -205,7 +204,7 @@ public:
* Allocate a gralloc SurfaceDescriptor remotely.
*/
bool
AllocSurfaceDescriptorGralloc(const gfxIntSize& aSize,
AllocSurfaceDescriptorGralloc(const gfx::IntSize& aSize,
const uint32_t& aFormat,
const uint32_t& aUsage,
SurfaceDescriptor* aBuffer);
@ -218,7 +217,7 @@ public:
* Must be called from the ImageBridgeChild thread.
*/
bool
AllocSurfaceDescriptorGrallocNow(const gfxIntSize& aSize,
AllocSurfaceDescriptorGrallocNow(const gfx::IntSize& aSize,
const uint32_t& aFormat,
const uint32_t& aUsage,
SurfaceDescriptor* aBuffer);
@ -385,7 +384,7 @@ protected:
CompositableTransaction* mTxn;
// ISurfaceAllocator
virtual PGrallocBufferChild* AllocGrallocBuffer(const gfxIntSize& aSize,
virtual PGrallocBufferChild* AllocGrallocBuffer(const gfx::IntSize& aSize,
uint32_t aFormat, uint32_t aUsage,
MaybeMagicGrallocBufferHandle* aHandle) MOZ_OVERRIDE;
};

Просмотреть файл

@ -11,7 +11,7 @@
#include "base/process_util.h" // for OpenProcessHandle
#include "base/task.h" // for CancelableTask, DeleteTask, etc
#include "base/tracked.h" // for FROM_HERE
#include "gfxPoint.h" // for gfxIntSize
#include "mozilla/gfx/Point.h" // for IntSize
#include "mozilla/ipc/MessageChannel.h" // for MessageChannel, etc
#include "mozilla/ipc/ProtocolUtils.h"
#include "mozilla/ipc/Transport.h" // for Transport
@ -34,6 +34,7 @@
using namespace base;
using namespace mozilla::ipc;
using namespace mozilla::gfx;
namespace mozilla {
namespace layers {
@ -149,7 +150,7 @@ static uint64_t GenImageContainerID() {
}
PGrallocBufferParent*
ImageBridgeParent::AllocPGrallocBufferParent(const gfxIntSize& aSize,
ImageBridgeParent::AllocPGrallocBufferParent(const IntSize& aSize,
const uint32_t& aFormat,
const uint32_t& aUsage,
MaybeMagicGrallocBufferHandle* aOutHandle)

Просмотреть файл

@ -9,7 +9,6 @@
#include <stddef.h> // for size_t
#include <stdint.h> // for uint32_t, uint64_t
#include "CompositableTransactionParent.h"
#include "gfxPoint.h" // for gfxIntSize
#include "mozilla/Assertions.h" // for MOZ_ASSERT_HELPER2
#include "mozilla/Attributes.h" // for MOZ_OVERRIDE
#include "mozilla/ipc/ProtocolUtils.h"
@ -49,7 +48,7 @@ public:
Create(Transport* aTransport, ProcessId aOtherProcess);
virtual PGrallocBufferParent*
AllocPGrallocBufferParent(const gfxIntSize&, const uint32_t&, const uint32_t&,
AllocPGrallocBufferParent(const IntSize&, const uint32_t&, const uint32_t&,
MaybeMagicGrallocBufferHandle*) MOZ_OVERRIDE;
virtual bool

Просмотреть файл

@ -30,10 +30,10 @@ LayerTransactionChild::Destroy()
}
PGrallocBufferChild*
LayerTransactionChild::AllocPGrallocBufferChild(const gfxIntSize&,
const uint32_t&,
const uint32_t&,
MaybeMagicGrallocBufferHandle*)
LayerTransactionChild::AllocPGrallocBufferChild(const IntSize&,
const uint32_t&,
const uint32_t&,
MaybeMagicGrallocBufferHandle*)
{
#ifdef MOZ_HAVE_SURFACEDESCRIPTORGRALLOC
return GrallocBufferActor::Create();

Просмотреть файл

@ -9,7 +9,6 @@
#define MOZILLA_LAYERS_LAYERTRANSACTIONCHILD_H
#include <stdint.h> // for uint32_t
#include "gfxPoint.h" // for gfxIntSize
#include "mozilla/Attributes.h" // for MOZ_OVERRIDE
#include "mozilla/ipc/ProtocolUtils.h"
#include "mozilla/layers/PLayerTransactionChild.h"
@ -47,9 +46,9 @@ protected:
friend class detail::RefCounted<LayerTransactionChild, detail::AtomicRefCount>;
virtual PGrallocBufferChild*
AllocPGrallocBufferChild(const gfxIntSize&,
const uint32_t&, const uint32_t&,
MaybeMagicGrallocBufferHandle*) MOZ_OVERRIDE;
AllocPGrallocBufferChild(const IntSize&,
const uint32_t&, const uint32_t&,
MaybeMagicGrallocBufferHandle*) MOZ_OVERRIDE;
virtual bool
DeallocPGrallocBufferChild(PGrallocBufferChild* actor) MOZ_OVERRIDE;

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше