Backed out 12 changesets (bug 958596) for several Android permafails to fix a CLOSED TREE

Backed out changeset e4c0e3d3a768 (bug 958596)
Backed out changeset 7bc4f48d6b05 (bug 958596)
Backed out changeset 89cd12e3db45 (bug 958596)
Backed out changeset 283411053340 (bug 958596)
Backed out changeset 5329fa8c8847 (bug 958596)
Backed out changeset 0d1d26d588e3 (bug 958596)
Backed out changeset 715fe9eb5dfd (bug 958596)
Backed out changeset 66dde9d67ffa (bug 958596)
Backed out changeset 79e589f75065 (bug 958596)
Backed out changeset 1ed4c880ab70 (bug 958596)
Backed out changeset 1d40b0b8036d (bug 958596)
Backed out changeset ad35d51d9781 (bug 958596)
This commit is contained in:
Wes Kocher 2014-02-25 18:34:47 -08:00
parent 9facb7071a
commit 26af0b1154
14 changed files with 43 additions and 253 deletions

View File

@ -7697,7 +7697,6 @@ XPCOM_LIBS="$LIBXUL_LIBS"
if test "$OS_ARCH" = "WINNT"; then
GKMEDIAS_SHARED_LIBRARY=1
AC_DEFINE(GKMEDIAS_SHARED_LIBRARY)
fi
AC_SUBST(GKMEDIAS_SHARED_LIBRARY)

View File

@ -492,8 +492,6 @@ public:
void ListAttributes(FILE* out) const;
#endif
void Describe(nsAString& aOutDescription) const MOZ_OVERRIDE;
/*
* Attribute Mapping Helpers
*/
@ -516,8 +514,6 @@ public:
}
private:
void DescribeAttribute(uint32_t index, nsAString& aOutDescription) const;
static bool
FindAttributeDependence(const nsIAtom* aAttribute,
const MappedAttributeEntry* const aMaps[],

View File

@ -950,15 +950,6 @@ public:
bool aDumpAll = true) const = 0;
#endif
/**
* Append to aOutDescription a short (preferably one line) string
* describing the content.
* Currently implemented for elements only.
*/
virtual void Describe(nsAString& aOutDescription) const {
aOutDescription = NS_LITERAL_STRING("(not an element)");
}
enum ETabFocusType {
//eTabFocus_textControlsMask = (1<<0), // unused - textboxes always tabbable
eTabFocus_formElementsMask = (1<<1), // non-text form elements

View File

@ -2132,35 +2132,30 @@ Element::GetAttrCount() const
return mAttrsAndChildren.AttrCount();
}
void
Element::DescribeAttribute(uint32_t index, nsAString& aOutDescription) const
{
// name
mAttrsAndChildren.AttrNameAt(index)->GetQualifiedName(aOutDescription);
// value
aOutDescription.AppendLiteral("=\"");
nsAutoString value;
mAttrsAndChildren.AttrAt(index)->ToString(value);
for (int i = value.Length(); i >= 0; --i) {
if (value[i] == char16_t('"'))
value.Insert(char16_t('\\'), uint32_t(i));
}
aOutDescription.Append(value);
aOutDescription.AppendLiteral("\"");
}
#ifdef DEBUG
void
Element::ListAttributes(FILE* out) const
{
uint32_t index, count = mAttrsAndChildren.AttrCount();
for (index = 0; index < count; index++) {
nsAutoString attributeDescription;
DescribeAttribute(index, attributeDescription);
nsAutoString buffer;
// name
mAttrsAndChildren.AttrNameAt(index)->GetQualifiedName(buffer);
// value
buffer.AppendLiteral("=\"");
nsAutoString value;
mAttrsAndChildren.AttrAt(index)->ToString(value);
for (int i = value.Length(); i >= 0; --i) {
if (value[i] == char16_t('"'))
value.Insert(char16_t('\\'), uint32_t(i));
}
buffer.Append(value);
buffer.AppendLiteral("\"");
fputs(" ", out);
fputs(NS_LossyConvertUTF16toASCII(attributeDescription).get(), out);
fputs(NS_LossyConvertUTF16toASCII(buffer).get(), out);
}
}
@ -2284,21 +2279,6 @@ Element::DumpContent(FILE* out, int32_t aIndent,
}
#endif
void
Element::Describe(nsAString& aOutDescription) const
{
aOutDescription.Append(mNodeInfo->QualifiedName());
aOutDescription.AppendPrintf("@%p", (void *)this);
uint32_t index, count = mAttrsAndChildren.AttrCount();
for (index = 0; index < count; index++) {
aOutDescription.Append(' ');
nsAutoString attributeDescription;
DescribeAttribute(index, attributeDescription);
aOutDescription.Append(attributeDescription);
}
}
bool
Element::CheckHandleEventForLinksPrecondition(nsEventChainVisitor& aVisitor,
nsIURI** aURI) const

View File

@ -53,8 +53,8 @@
#include "mozilla/CheckedInt.h"
#if defined(DEBUG) || defined(PR_LOGGING)
GFX2D_API PRLogModuleInfo *
#ifdef PR_LOGGING
PRLogModuleInfo *
GetGFX2DLog()
{
static PRLogModuleInfo *sLog;
@ -156,7 +156,7 @@ namespace mozilla {
namespace gfx {
// XXX - Need to define an API to set this.
GFX2D_API int sGfxLogLevel = LOG_DEBUG;
int sGfxLogLevel = LOG_DEBUG;
#ifdef WIN32
ID3D10Device1 *Factory::mD3D10Device;

View File

@ -10,27 +10,17 @@
#include <sstream>
#include <stdio.h>
#include "nsDebug.h"
#include "Point.h"
#include "BaseRect.h"
#include "Matrix.h"
#include "mozilla/TypedEnum.h"
#ifdef WIN32
// This file gets included from nsGlobalWindow.cpp, which doesn't like
// having windows.h included in it. Since OutputDebugStringA is the only
// thing we need from windows.h, we just declare it here directly.
// Note: the function's documented signature is
// WINBASEAPI void WINAPI OutputDebugStringA(LPCSTR lpOutputString)
// but if we don't include windows.h, the macros WINBASEAPI, WINAPI, and
// LPCSTR are not defined, so we need to replace them with their expansions.
extern "C" __declspec(dllimport) void __stdcall OutputDebugStringA(const char* lpOutputString);
#include <windows.h>
#endif
#if defined(DEBUG) || defined(PR_LOGGING)
#ifdef PR_LOGGING
#include <prlog.h>
extern GFX2D_API PRLogModuleInfo *GetGFX2DLog();
extern PRLogModuleInfo *GetGFX2DLog();
#endif
namespace mozilla {
@ -39,7 +29,7 @@ namespace gfx {
const int LOG_DEBUG = 1;
const int LOG_WARNING = 2;
#if defined(DEBUG) || defined(PR_LOGGING)
#ifdef PR_LOGGING
inline PRLogModuleLevel PRLogLevelForLevel(int aLevel) {
switch (aLevel) {
@ -53,20 +43,20 @@ inline PRLogModuleLevel PRLogLevelForLevel(int aLevel) {
#endif
extern GFX2D_API int sGfxLogLevel;
extern int sGfxLogLevel;
static inline void OutputMessage(const std::string &aString, int aLevel) {
#if defined(WIN32) && !defined(PR_LOGGING)
if (aLevel >= sGfxLogLevel) {
::OutputDebugStringA(aString.c_str());
}
#elif defined(PR_LOGGING) && !(defined(MOZ_WIDGET_GONK) || defined(MOZ_WIDGET_ANDROID))
#elif defined(PR_LOGGING)
if (PR_LOG_TEST(GetGFX2DLog(), PRLogLevelForLevel(aLevel))) {
PR_LogPrint(aString.c_str());
}
#else
if (aLevel >= sGfxLogLevel) {
printf_stderr("%s", aString.c_str());
printf("%s", aString.c_str());
}
#endif
}
@ -81,49 +71,29 @@ public:
NoLog &operator <<(const T &aLogText) { return *this; }
};
MOZ_BEGIN_ENUM_CLASS(LogOptions, int)
NoNewline = 0x01
MOZ_END_ENUM_CLASS(LogOptions)
template<int L>
class Log
{
public:
Log(LogOptions aOptions = LogOptions(0)) : mOptions(aOptions) {}
~Log() {
Flush();
}
Log() {}
~Log() { mMessage << '\n'; WriteLog(mMessage.str()); }
void Flush() {
if (!(int(mOptions) & int(LogOptions::NoNewline))) {
mMessage << '\n';
}
std::string str = mMessage.str();
if (!str.empty()) {
WriteLog(str);
}
mMessage.str("");
mMessage.clear();
}
Log &operator <<(char aChar) { mMessage << aChar; return *this; }
Log &operator <<(const std::string &aLogText) { mMessage << aLogText; return *this; }
Log &operator <<(const char aStr[]) { mMessage << static_cast<const char*>(aStr); return *this; }
Log &operator <<(bool aBool) { mMessage << (aBool ? "true" : "false"); return *this; }
Log &operator <<(int32_t aInt) { mMessage << aInt; return *this; }
Log &operator <<(uint32_t aInt) { mMessage << aInt; return *this; }
Log &operator <<(int64_t aLong) { mMessage << aLong; return *this; }
Log &operator <<(uint64_t aLong) { mMessage << aLong; return *this; }
Log &operator <<(int aInt) { mMessage << aInt; return *this; }
Log &operator <<(unsigned int aInt) { mMessage << aInt; return *this; }
Log &operator <<(long aLong) { mMessage << aLong; return *this; }
Log &operator <<(unsigned long aLong) { mMessage << aLong; return *this; }
Log &operator <<(Float aFloat) { mMessage << aFloat; return *this; }
Log &operator <<(double aDouble) { mMessage << aDouble; return *this; }
template <typename T, typename Sub>
Log &operator <<(const BasePoint<T, Sub>& aPoint)
Log &operator <<(const Point &aPoint)
{ mMessage << "Point(" << aPoint.x << "," << aPoint.y << ")"; return *this; }
template <typename T, typename Sub>
Log &operator <<(const BaseSize<T, Sub>& aSize)
Log &operator <<(const Size &aSize)
{ mMessage << "Size(" << aSize.width << "," << aSize.height << ")"; return *this; }
template <typename T, typename Sub, typename Point, typename SizeT, typename Margin>
Log &operator <<(const BaseRect<T, Sub, Point, SizeT, Margin>& aRect)
Log &operator <<(const IntSize &aSize)
{ mMessage << "IntSize(" << aSize.width << "," << aSize.height << ")"; return *this; }
Log &operator <<(const Rect &aRect)
{ mMessage << "Rect(" << aRect.x << "," << aRect.y << "," << aRect.width << "," << aRect.height << ")"; return *this; }
Log &operator<<(const Matrix& aMatrix)
{ mMessage << "Matrix(" << aMatrix._11 << " " << aMatrix._12 << " ; " << aMatrix._21 << " " << aMatrix._22 << " ; " << aMatrix._31 << " " << aMatrix._32 << ")"; return *this; }
@ -136,7 +106,6 @@ private:
}
std::stringstream mMessage;
LogOptions mOptions;
};
typedef Log<LOG_DEBUG> DebugLog;
@ -153,84 +122,6 @@ typedef Log<LOG_WARNING> WarningLog;
#define gfxWarning if (1) ; else NoLog
#endif
const int INDENT_PER_LEVEL = 2;
class TreeLog
{
public:
TreeLog(const std::string& aPrefix = "")
: mLog(LogOptions::NoNewline),
mPrefix(aPrefix),
mDepth(0),
mStartOfLine(true),
mConditionedOnPref(false),
mPref(nullptr) {}
template <typename T>
TreeLog& operator<<(const T& aObject) {
if (mConditionedOnPref && !*mPref) {
return *this;
}
if (mStartOfLine) {
mLog << '[' << mPrefix << "] " << std::string(mDepth * INDENT_PER_LEVEL, ' ');
mStartOfLine = false;
}
mLog << aObject;
if (EndsInNewline(aObject)) {
// Don't indent right here as the user may change the indent
// between now and the first output to the next line.
mLog.Flush();
mStartOfLine = true;
}
return *this;
}
void IncreaseIndent() { ++mDepth; }
void DecreaseIndent() { --mDepth; }
void ConditionOnPref(bool* aPref) {
mConditionedOnPref = true;
mPref = aPref;
}
private:
Log<LOG_DEBUG> mLog;
std::string mPrefix;
uint32_t mDepth;
bool mStartOfLine;
bool mConditionedOnPref;
bool* mPref;
template <typename T>
static bool EndsInNewline(const T& aObject) {
return false;
}
static bool EndsInNewline(const std::string& aString) {
return !aString.empty() && aString[aString.length() - 1] == '\n';
}
static bool EndsInNewline(char aChar) {
return aChar == '\n';
}
static bool EndsInNewline(const char* aString) {
return EndsInNewline(std::string(aString));
}
};
class TreeAutoIndent
{
public:
TreeAutoIndent(TreeLog& aTreeLog) : mTreeLog(aTreeLog) {
mTreeLog.IncreaseIndent();
}
~TreeAutoIndent() {
mTreeLog.DecreaseIndent();
}
private:
TreeLog& mTreeLog;
};
}
}

View File

@ -97,7 +97,7 @@ struct RectTyped :
Super(float(rect.x), float(rect.y),
float(rect.width), float(rect.height)) {}
void NudgeToIntegers()
GFX2D_API void NudgeToIntegers()
{
NudgeToInteger(&(this->x));
NudgeToInteger(&(this->y));

View File

@ -246,7 +246,7 @@ struct GradientStop
}
}
#if defined(XP_WIN) && defined(GKMEDIAS_SHARED_LIBRARY)
#if defined(XP_WIN) && defined(MOZ_GFX)
#ifdef GFX2D_INTERNAL
#define GFX2D_API __declspec(dllexport)
#else

View File

@ -21,7 +21,6 @@ EXPORTS.mozilla.gfx += [
'DataSurfaceHelpers.h',
'Filters.h',
'Helpers.h',
'Logging.h',
'Matrix.h',
'PathHelpers.h',
'Point.h',

View File

@ -623,7 +623,6 @@ struct ParamTraits<mozilla::layers::FrameMetrics>
WriteParam(aMsg, aParam.mDisableScrollingY);
WriteParam(aMsg, aParam.mUpdateScrollOffset);
WriteParam(aMsg, aParam.mScrollGeneration);
WriteParam(aMsg, aParam.mContentDescription);
}
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
@ -646,8 +645,7 @@ struct ParamTraits<mozilla::layers::FrameMetrics>
ReadParam(aMsg, aIter, &aResult->mDisableScrollingX) &&
ReadParam(aMsg, aIter, &aResult->mDisableScrollingY) &&
ReadParam(aMsg, aIter, &aResult->mUpdateScrollOffset) &&
ReadParam(aMsg, aIter, &aResult->mScrollGeneration) &&
ReadParam(aMsg, aIter, &aResult->mContentDescription));
ReadParam(aMsg, aIter, &aResult->mScrollGeneration));
}
};

View File

@ -7,12 +7,10 @@
#define GFX_FRAMEMETRICS_H
#include <stdint.h> // for uint32_t, uint64_t
#include <string> // for std::string
#include "Units.h" // for CSSRect, CSSPixel, etc
#include "mozilla/gfx/BasePoint.h" // for BasePoint
#include "mozilla/gfx/Rect.h" // for RoundedIn
#include "mozilla/gfx/ScaleFactor.h" // for ScaleFactor
#include "mozilla/gfx/Logging.h" // for Log
namespace IPC {
template <typename T> struct ParamTraits;
@ -72,8 +70,6 @@ public:
bool operator==(const FrameMetrics& aOther) const
{
// mContentDescription is not compared on purpose as it's only used
// for debugging.
return mCompositionBounds.IsEqualEdges(aOther.mCompositionBounds) &&
mDisplayPort.IsEqualEdges(aOther.mDisplayPort) &&
mCriticalDisplayPort.IsEqualEdges(aOther.mCriticalDisplayPort) &&
@ -340,16 +336,6 @@ public:
return mScrollGeneration;
}
const std::string& GetContentDescription() const
{
return mContentDescription;
}
void SetContentDescription(const std::string& aContentDescription)
{
mContentDescription = aContentDescription;
}
private:
// New fields from now on should be made private and old fields should
// be refactored to be private.
@ -364,10 +350,6 @@ private:
bool mUpdateScrollOffset;
// The scroll generation counter used to acknowledge the scroll offset update.
uint32_t mScrollGeneration;
// A description of the content element corresponding to this frame.
// This is empty unless the apz.printtree pref is turned on.
std::string mContentDescription;
};
/**
@ -426,11 +408,6 @@ struct ScrollableLayerGuid {
}
};
template <int LogLevel>
gfx::Log<LogLevel>& operator<<(gfx::Log<LogLevel>& log, const ScrollableLayerGuid& aGuid) {
return log << '(' << aGuid.mLayersId << ',' << aGuid.mPresShellId << ',' << aGuid.mScrollId << ')';
}
struct ZoomConstraints {
bool mAllowZoom;
bool mAllowDoubleTapZoom;

View File

@ -16,11 +16,9 @@
#include "mozilla/MouseEvents.h"
#include "mozilla/mozalloc.h" // for operator new
#include "mozilla/TouchEvents.h"
#include "mozilla/Preferences.h" // for Preferences
#include "nsDebug.h" // for NS_WARNING
#include "nsPoint.h" // for nsIntPoint
#include "nsThreadUtils.h" // for NS_IsMainThread
#include "mozilla/gfx/Logging.h" // for gfx::TreeLog
#include <algorithm> // for std::stable_sort
@ -32,19 +30,12 @@ namespace layers {
float APZCTreeManager::sDPI = 160.0;
// Pref that enables printing of the APZC tree for debugging.
static bool gPrintApzcTree = false;
gfx::TreeLog sApzcTreeLog("apzctree");
APZCTreeManager::APZCTreeManager()
: mTreeLock("APZCTreeLock"),
mTouchCount(0)
{
MOZ_ASSERT(NS_IsMainThread());
AsyncPanZoomController::InitializeGlobalState();
Preferences::AddBoolVarCache(&gPrintApzcTree, "apz.printtree", gPrintApzcTree);
sApzcTreeLog.ConditionOnPref(&gPrintApzcTree);
}
APZCTreeManager::~APZCTreeManager()
@ -125,7 +116,6 @@ APZCTreeManager::UpdatePanZoomControllerTree(CompositorParent* aCompositor, Laye
mRootApzc = nullptr;
if (aRoot) {
sApzcTreeLog << "[start]\n";
UpdatePanZoomControllerTree(aCompositor,
aRoot,
// aCompositor is null in gtest scenarios
@ -133,7 +123,6 @@ APZCTreeManager::UpdatePanZoomControllerTree(CompositorParent* aCompositor, Laye
gfx3DMatrix(), nullptr, nullptr,
aIsFirstPaint, aFirstPaintLayersId,
&apzcsToDestroy);
sApzcTreeLog << "[end]\n";
}
for (size_t i = 0; i < apzcsToDestroy.Length(); i++) {
@ -155,7 +144,6 @@ APZCTreeManager::UpdatePanZoomControllerTree(CompositorParent* aCompositor,
ContainerLayer* container = aLayer->AsContainerLayer();
AsyncPanZoomController* apzc = nullptr;
sApzcTreeLog << aLayer->Name() << '\t';
if (container) {
if (container->GetFrameMetrics().IsScrollable()) {
const CompositorParent::LayerTreeState* state = CompositorParent::GetIndirectShadowTree(aLayersId);
@ -170,8 +158,7 @@ APZCTreeManager::UpdatePanZoomControllerTree(CompositorParent* aCompositor,
// be possible because of DLBI heuristics) then we don't want to keep using
// the same old APZC for the new content. Null it out so we run through the
// code to find another one or create one.
ScrollableLayerGuid guid(aLayersId, container->GetFrameMetrics());
if (apzc && !apzc->Matches(guid)) {
if (apzc && !apzc->Matches(ScrollableLayerGuid(aLayersId, container->GetFrameMetrics()))) {
apzc = nullptr;
}
@ -182,8 +169,9 @@ APZCTreeManager::UpdatePanZoomControllerTree(CompositorParent* aCompositor,
// underlying content for which the APZC was originally created is still
// there. So it makes sense to pick up that APZC instance again and use it here.
if (apzc == nullptr) {
ScrollableLayerGuid target(aLayersId, container->GetFrameMetrics());
for (size_t i = 0; i < aApzcsToDestroy->Length(); i++) {
if (aApzcsToDestroy->ElementAt(i)->Matches(guid)) {
if (aApzcsToDestroy->ElementAt(i)->Matches(target)) {
apzc = aApzcsToDestroy->ElementAt(i);
break;
}
@ -234,11 +222,6 @@ APZCTreeManager::UpdatePanZoomControllerTree(CompositorParent* aCompositor,
visible.width, visible.height,
apzc);
sApzcTreeLog << "APZC " << guid
<< "\tcb=" << visible
<< "\tsr=" << container->GetFrameMetrics().mScrollableRect
<< "\t" << container->GetFrameMetrics().GetContentDescription();
// Bind the APZC instance into the tree of APZCs
if (aNextSibling) {
aNextSibling->SetPrevSibling(apzc);
@ -273,7 +256,6 @@ APZCTreeManager::UpdatePanZoomControllerTree(CompositorParent* aCompositor,
container->SetAsyncPanZoomController(apzc);
}
sApzcTreeLog << '\n';
// Accumulate the CSS transform between layers that have an APZC, but exclude any
// any layers that do have an APZC, and reset the accumulation at those layers.
@ -291,7 +273,6 @@ APZCTreeManager::UpdatePanZoomControllerTree(CompositorParent* aCompositor,
// have our siblings as siblings.
AsyncPanZoomController* next = apzc ? nullptr : aNextSibling;
for (Layer* child = aLayer->GetLastChild(); child; child = child->GetPrevSibling()) {
gfx::TreeAutoIndent indent(sApzcTreeLog);
next = UpdatePanZoomControllerTree(aCompositor, child, childLayersId, aTransform, aParent, next,
aIsFirstPaint, aFirstPaintLayersId, aApzcsToDestroy);
}

View File

@ -592,17 +592,6 @@ static void AdjustForScrollBars(ScreenIntRect& aToAdjust, nsIScrollableFrame* aS
}
}
static bool gPrintApzcTree = false;
static bool GetApzcTreePrintPref() {
static bool initialized = false;
if (!initialized) {
Preferences::AddBoolVarCache(&gPrintApzcTree, "apz.printtree", gPrintApzcTree);
initialized = true;
}
return gPrintApzcTree;
}
static void RecordFrameMetrics(nsIFrame* aForFrame,
nsIFrame* aScrollFrame,
const nsIFrame* aReferenceFrame,
@ -744,14 +733,6 @@ static void RecordFrameMetrics(nsIFrame* aForFrame,
AdjustForScrollBars(metrics.mCompositionBounds, scrollableFrame);
}
if (GetApzcTreePrintPref()) {
if (nsIContent* content = frameForCompositionBoundsCalculation->GetContent()) {
nsAutoString contentDescription;
content->Describe(contentDescription);
metrics.SetContentDescription(NS_LossyConvertUTF16toASCII(contentDescription).get());
}
}
metrics.mPresShellId = presShell->GetPresShellId();
// If the scroll frame's content is marked 'scrollgrab', record this

View File

@ -308,9 +308,6 @@ pref("media.audio_data.enabled", false);
// 2 = STICKY (Allow lock to be broken, with hysteresis)
pref("apz.axis_lock_mode", 0);
// Whether to print the APZC tree for debugging
pref("apz.printtree", false);
#ifdef XP_MACOSX
// Whether to run in native HiDPI mode on machines with "Retina"/HiDPI display;
// <= 0 : hidpi mode disabled, display will just use pixel-based upscaling