mirror of
https://github.com/roytam1/palemoon27.git
synced 2026-05-29 18:18:27 +00:00
e1776c67f8
- Bug 1199885 - Part 2: Add AsyncDragMetrics. r=kats (220a4f445e)
- Bug 1149482 - Localize the 'none' string for APZ in about:support. r=dvander (3e0128f62e)
- Bug 1199885 - Part 3: Add 'apz.drag.enabled' preference for async scrollbars. r=kats (5133061d3f)
- Bug 1199885 - Part 4: Let the hit testing tree know about the scroll thumb. r=kats (26a9a69443)
- Bug 1199885 - Part 5: Make mRootLayerTreeID const to prove that there's no data races. r=kats (88e2eb80f1)
- Bug 1199885 - Part 8: Add FindScrollNode to locate the scrollbar thumb. r=kats (a545ec9569)
- Bug 1199885 - Part 9: Let APZC handle the drag events. r=kats (4cc0f88153)
- Bug 1199885 - Part 9.5: Make the mouse events APZC aware. r=kats (69bd4caf94)
- Bug 1199885 - Part 10: Add APZTeeManager API to start an async scroll. r=kats (e212ee2750)
- Bug 1199885 - Part 12: Add StartScrollbarDrag IPC message. r=kats (705af3b233)
- Bug 1199885 - Part 13: Let nsSliderFrame trigger async scrolling via StartScrollbarDrag. r=kats (d31b5a790d)
- put in gstreamer as of 2015-10-05 Bug 1146482 (7cca45858c)
- pointer style (f8041af438)
- Bug 1197097 - Don't use a context-wide cycle-detection mechanism for detecting cycles during JSON.stringify. This prevents nested (yet separate) JSON.stringify, and it causes that algorithm to be affected by specification-unrelated operations like toSource. r=jonco (09652471c1)
- align to ugly grammaer of 1114782 (c760693693)
- remove space (7158a0c2bf)
- align to FF/TFF (27138a55bb)
- Bug 1205887 - Verify that MOZILLA_VERSION was set correctly, r=glandium (2269e8f31b)
- Bug 1205012 - Allow rust source code in SpiderMonkey; r=mshal (9ebca9ed28)
- Bug 1197281 - Use MOZ_FIND_WINSDK_VERSION for MOZ_WINSDK_MAXVER on mingw. r=glandium (2910b2160e)
- Bug 1207893 - Refactor how build backend execution is summarized. r=gps (56d8fecbc2)
- Bug 1207893 - Allow to create multiple build backends at once. r=gps (d8cba87d2b)
- Bug 1207897 - Add a configure option to build multiple build backends. r=gps (f9c7851d02)
- Bug 1188555 - part 1 - remove write-only configure.in variable NO_LD_ARCHIVE_FLAGS; r=mshal (461958b100)
- Bug 1188555 - part 2 - remove write-only configure.in variables MKSHLIB_{UN,}FORCE_ALL; r=mshal (1813210dda)
- Bug 1207882 - Ensure chrome manifests are created in a directory that exists when processing jar manifests. r=gps (59165a64cb)
- Bug 1204712 - Handle wildcards properly for localized content in jar manifests. r=gps (54dfb632c7)
- Bug 1188551: treat assertion failures as bad mozconfig; r=mshal (e307769de7)
- Bug 1181040 - Set ${var}_IS_SET variables for mk_add_options-defined variables. r=gps (19f169556b)
- Bug 1193015 - Require MOZ_GLX_USE_SURFACE_SHARING to enable WebGL surface sharing on GLX. r=jgilbert (9aa4fa8f41)
- Bug 1211324 (part 1) - Remove BILINEAR and GAUSSIAN filter constants. (3d9290ef02)
- Bug 1211324 (part 2) - Make gfx::FILTER::GOOD convert to GraphicsFilter::FILTER_GOOD. r=mattwoodrow. (16e7607c70)
- Bug 1208365 (part 1) - Remove unused EXTEND_PAD_EDGE. r=Bas. (10920e2bb6)
- Bug 1208365 (part 2) - Remove gfxPattern::Extend(). r=bas. (3703b9748a)
- Bug 1208365 (part 3) - Change gfxPattern::mExtend from a GraphicsExtend to a gfx::ExtendMode. r=bas. (b105d06e91)
- Bug 1208365 (part 4) - Remove gfxPattern::GraphicsExtend. r=bas. (7a16d48995)
- Bug 1211324 (part 3) - Remove GraphicsFilter::FILTER_FAST and replace it with FILTER_BEST. r=mattwoodrow. (b5101e049f)
- Bug 1211324 (part 4) - Replace GraphicsFilter constants with gfx::Filter equivalents. r=mattwoodrow. (c19b6b030e)
- Bug 1190117 - Track mLastProducerID and mLastFrameID explicitly in ImageLayerProperties. r=roc (ed9a5c777f)
- Bug 1211324 (part 5) - Remove GraphicsFilter and gfxGraphicsFilter. r=mattwoodrow. (0bd4ce7160)
- Bug 1194954 - Fix -Wunreachable-code warnings in gfx/layers and gfx/thebes. r=BenWa (1a3d68c490)
- Bug 1180509 - Fix judder of icons in Australis doorhanger menu at the end of its scale-in animation. r=roc (9b4df470fa)
- Bug 1206915 - Make paint dumping to a file e10s-friendly. r=mattwoodrow (87d2e12c2b)
- Bug 1206915 - Handle nested PaintFrame() calls correctly during paint dumping. r=mattwoodrow,BenWa (d30f77fbdd)
- Fix max texture size handling in displayport clamping. (bug 1135907 follow-up, r=kats) (a791894332)
- Fix bogus assertion in nsLayoutUtils::SetDisplayPortMargins. (bug 1156409, r=botond, a=philor) (b635b21c34)
- Bug 1169879 - Use only the critical displayport when computing image visibility. r=tn (9ec91c9527)
- Bug 1169881 - Recompute image visibility when display port margins change. r=tn (35a5bd3a51)
- Bug 1197765 - Compare text content inside frame instead of the content node for ruby autohiding. r=dbaron (00cf5b7674)
- Bug 1173580 - Record content descriptions in APZ test data. r=kats (7a72d1ac0a)
- Bug 1178971 - Changed line snapping behaviour depending on even/odd-ness of stroke width. r=mstange (495b32dc23)
- Bug 1208953: [mp3] Don't parse data we've already parsed. r=cpearce (72eed4309f)
- Bug 1137151: Marked destructor of |android::MediaCodecReader| as protected, r=sotaro (0632b34bc5)
- Bug 1205351 - Replace nsBaseHashtable::Enumerate() calls in dom/media/ with iterators r=cpearce (45976c24c0)
- Bug 1133624 - Add lang-specific ruby rules to ua.css. r=dbaron (46788cc220)
- Bug 1133624 - followup add fuzzy maxdiff on CLOSED TREE (1b6b62aded)
- Bug 1180443 - Consider whitespace collapse when calculating intrinsic isize of ruby. r=dbaron (3862184acd)
- Bug 1153764 - Avoid explicitly doing break before when there is ruby span. r=roc (71b4ec7749)
- add gstreamer parts (7e562556be)
- some preferences aligned to FF (b26d0b389c)
- Bug 1166301 - If APZ is enabled, clip fixed background images at the layer level rather than the display item level. r=mattwoodrow (5644e22090)
- Bug 1144990 - Dump display items with class id and name, r=roc (aa2e227e35)
- Bug 1205087 - Remove LayerManager parameter for ShouldFixToViewport. r=roc (00a1f2e36f)
- Bug 1205087 - Make nsSVGIntegrationUtils paint frame continuations manually since combining them meant that our reference frame wasn't an ancestor of all painted frames. r=roc (e40f6b7b81)
- Bug 1195400 - Check ancestor geometry roots when determining scrollability of a layer. r=mattwoodrow (4699b7e935)
- Bug 1205087 - Cache the AnimatedGeometryRoot on DisplayItem. r=roc (06bba311c3)
- Back out the bits of bug 1205087 that cache the AnimatedGeometryRoot on DisplayItem. r=backout (254057a6b6)
- Bug 1203190 - Don't intersect with the visible rect for fixed background images. r=mattwoodrow (1c5a432459)
- Bug 1208438 - Don't allow layers with scrolling clips to occlusion-cull layers behind them. r=mattwoodrow (c3d77a9846)
- Bug 1205630 - Translate a fixed background display item's clip rect correctly when setting it on the layer. r=mstange (49039f0e2d)
- Bug 1205630 - Reftest. r=mstange (a8db59eaee)
- Bug 1105832 - Also dump inactive layer managers when display list dumping is enabled. r=mattwoodrow (564fe5fcbc)
- Bug 1208661 - Move Dump() up from ContentClient to CompositableClient. r=BenWa (37915312b3)
1137 lines
33 KiB
C++
1137 lines
33 KiB
C++
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
/* vim: set sw=2 ts=8 et tw=80 : */
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
#ifndef __GFXMESSAGEUTILS_H__
|
|
#define __GFXMESSAGEUTILS_H__
|
|
|
|
#include "base/process_util.h"
|
|
#include "chrome/common/ipc_message_utils.h"
|
|
#include "ipc/IPCMessageUtils.h"
|
|
|
|
#include <stdint.h>
|
|
|
|
#include "mozilla/gfx/Matrix.h"
|
|
#include "gfxPoint.h"
|
|
#include "gfxRect.h"
|
|
#include "nsRect.h"
|
|
#include "nsRegion.h"
|
|
#include "gfxTypes.h"
|
|
#include "mozilla/layers/AsyncDragMetrics.h"
|
|
#include "mozilla/layers/LayersTypes.h"
|
|
#include "mozilla/layers/CompositorTypes.h"
|
|
#include "FrameMetrics.h"
|
|
#include "FilterSupport.h"
|
|
#include "mozilla/layers/GeckoContentController.h"
|
|
|
|
#ifdef _MSC_VER
|
|
#pragma warning( disable : 4800 )
|
|
#endif
|
|
|
|
namespace mozilla {
|
|
|
|
typedef gfxImageFormat PixelFormat;
|
|
|
|
} // namespace mozilla
|
|
|
|
namespace IPC {
|
|
|
|
template<>
|
|
struct ParamTraits<mozilla::gfx::Matrix>
|
|
{
|
|
typedef mozilla::gfx::Matrix paramType;
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam)
|
|
{
|
|
WriteParam(aMsg, aParam._11);
|
|
WriteParam(aMsg, aParam._12);
|
|
WriteParam(aMsg, aParam._21);
|
|
WriteParam(aMsg, aParam._22);
|
|
WriteParam(aMsg, aParam._31);
|
|
WriteParam(aMsg, aParam._32);
|
|
}
|
|
|
|
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
|
|
{
|
|
if (ReadParam(aMsg, aIter, &aResult->_11) &&
|
|
ReadParam(aMsg, aIter, &aResult->_12) &&
|
|
ReadParam(aMsg, aIter, &aResult->_21) &&
|
|
ReadParam(aMsg, aIter, &aResult->_22) &&
|
|
ReadParam(aMsg, aIter, &aResult->_31) &&
|
|
ReadParam(aMsg, aIter, &aResult->_32))
|
|
return true;
|
|
|
|
return false;
|
|
}
|
|
|
|
static void Log(const paramType& aParam, std::wstring* aLog)
|
|
{
|
|
aLog->append(StringPrintf(L"[[%g %g] [%g %g] [%g %g]]", aParam._11, aParam._12, aParam._21, aParam._22,
|
|
aParam._31, aParam._32));
|
|
}
|
|
};
|
|
|
|
template<>
|
|
struct ParamTraits<mozilla::gfx::Matrix4x4>
|
|
{
|
|
typedef mozilla::gfx::Matrix4x4 paramType;
|
|
|
|
static void Write(Message* msg, const paramType& param)
|
|
{
|
|
#define Wr(_f) WriteParam(msg, param. _f)
|
|
Wr(_11); Wr(_12); Wr(_13); Wr(_14);
|
|
Wr(_21); Wr(_22); Wr(_23); Wr(_24);
|
|
Wr(_31); Wr(_32); Wr(_33); Wr(_34);
|
|
Wr(_41); Wr(_42); Wr(_43); Wr(_44);
|
|
#undef Wr
|
|
}
|
|
|
|
static bool Read(const Message* msg, void** iter, paramType* result)
|
|
{
|
|
#define Rd(_f) ReadParam(msg, iter, &result-> _f)
|
|
return (Rd(_11) && Rd(_12) && Rd(_13) && Rd(_14) &&
|
|
Rd(_21) && Rd(_22) && Rd(_23) && Rd(_24) &&
|
|
Rd(_31) && Rd(_32) && Rd(_33) && Rd(_34) &&
|
|
Rd(_41) && Rd(_42) && Rd(_43) && Rd(_44));
|
|
#undef Rd
|
|
}
|
|
};
|
|
|
|
template<>
|
|
struct ParamTraits<mozilla::gfx::Matrix5x4>
|
|
{
|
|
typedef mozilla::gfx::Matrix5x4 paramType;
|
|
|
|
static void Write(Message* msg, const paramType& param)
|
|
{
|
|
#define Wr(_f) WriteParam(msg, param. _f)
|
|
Wr(_11); Wr(_12); Wr(_13); Wr(_14);
|
|
Wr(_21); Wr(_22); Wr(_23); Wr(_24);
|
|
Wr(_31); Wr(_32); Wr(_33); Wr(_34);
|
|
Wr(_41); Wr(_42); Wr(_43); Wr(_44);
|
|
Wr(_51); Wr(_52); Wr(_53); Wr(_54);
|
|
#undef Wr
|
|
}
|
|
|
|
static bool Read(const Message* msg, void** iter, paramType* result)
|
|
{
|
|
#define Rd(_f) ReadParam(msg, iter, &result-> _f)
|
|
return (Rd(_11) && Rd(_12) && Rd(_13) && Rd(_14) &&
|
|
Rd(_21) && Rd(_22) && Rd(_23) && Rd(_24) &&
|
|
Rd(_31) && Rd(_32) && Rd(_33) && Rd(_34) &&
|
|
Rd(_41) && Rd(_42) && Rd(_43) && Rd(_44) &&
|
|
Rd(_51) && Rd(_52) && Rd(_53) && Rd(_54));
|
|
#undef Rd
|
|
}
|
|
};
|
|
|
|
template<>
|
|
struct ParamTraits<gfxPoint>
|
|
{
|
|
typedef gfxPoint paramType;
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam)
|
|
{
|
|
WriteParam(aMsg, aParam.x);
|
|
WriteParam(aMsg, aParam.y);
|
|
}
|
|
|
|
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
|
|
{
|
|
return (ReadParam(aMsg, aIter, &aResult->x) &&
|
|
ReadParam(aMsg, aIter, &aResult->y));
|
|
}
|
|
};
|
|
|
|
template<>
|
|
struct ParamTraits<gfxSize>
|
|
{
|
|
typedef gfxSize paramType;
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam)
|
|
{
|
|
WriteParam(aMsg, aParam.width);
|
|
WriteParam(aMsg, aParam.height);
|
|
}
|
|
|
|
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
|
|
{
|
|
if (ReadParam(aMsg, aIter, &aResult->width) &&
|
|
ReadParam(aMsg, aIter, &aResult->height))
|
|
return true;
|
|
|
|
return false;
|
|
}
|
|
};
|
|
|
|
template<>
|
|
struct ParamTraits<gfxRect>
|
|
{
|
|
typedef gfxRect paramType;
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam)
|
|
{
|
|
WriteParam(aMsg, aParam.x);
|
|
WriteParam(aMsg, aParam.y);
|
|
WriteParam(aMsg, aParam.width);
|
|
WriteParam(aMsg, aParam.height);
|
|
}
|
|
|
|
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
|
|
{
|
|
return ReadParam(aMsg, aIter, &aResult->x) &&
|
|
ReadParam(aMsg, aIter, &aResult->y) &&
|
|
ReadParam(aMsg, aIter, &aResult->width) &&
|
|
ReadParam(aMsg, aIter, &aResult->height);
|
|
}
|
|
};
|
|
|
|
template <>
|
|
struct ParamTraits<gfxContentType>
|
|
: public ContiguousEnumSerializer<
|
|
gfxContentType,
|
|
gfxContentType::COLOR,
|
|
gfxContentType::SENTINEL>
|
|
{};
|
|
|
|
template <>
|
|
struct ParamTraits<gfxSurfaceType>
|
|
: public ContiguousEnumSerializer<
|
|
gfxSurfaceType,
|
|
gfxSurfaceType::Image,
|
|
gfxSurfaceType::Max>
|
|
{};
|
|
|
|
template <>
|
|
struct ParamTraits<mozilla::gfx::Filter>
|
|
: public ContiguousEnumSerializer<
|
|
mozilla::gfx::Filter,
|
|
mozilla::gfx::Filter::GOOD,
|
|
mozilla::gfx::Filter::SENTINEL>
|
|
{};
|
|
|
|
template <>
|
|
struct ParamTraits<mozilla::layers::LayersBackend>
|
|
: public ContiguousEnumSerializer<
|
|
mozilla::layers::LayersBackend,
|
|
mozilla::layers::LayersBackend::LAYERS_NONE,
|
|
mozilla::layers::LayersBackend::LAYERS_LAST>
|
|
{};
|
|
|
|
template <>
|
|
struct ParamTraits<mozilla::layers::ScaleMode>
|
|
: public ContiguousEnumSerializer<
|
|
mozilla::layers::ScaleMode,
|
|
mozilla::layers::ScaleMode::SCALE_NONE,
|
|
mozilla::layers::ScaleMode::SENTINEL>
|
|
{};
|
|
|
|
template <>
|
|
struct ParamTraits<gfxImageFormat>
|
|
: public ContiguousEnumSerializer<
|
|
gfxImageFormat,
|
|
gfxImageFormat::ARGB32,
|
|
gfxImageFormat::Unknown>
|
|
{};
|
|
|
|
template <>
|
|
struct ParamTraits<mozilla::gfx::AttributeName>
|
|
: public ContiguousEnumSerializer<
|
|
mozilla::gfx::AttributeName,
|
|
mozilla::gfx::eBlendBlendmode,
|
|
mozilla::gfx::eLastAttributeName>
|
|
{};
|
|
|
|
template <>
|
|
struct ParamTraits<mozilla::gfx::AttributeType>
|
|
: public ContiguousEnumSerializer<
|
|
mozilla::gfx::AttributeType,
|
|
mozilla::gfx::AttributeType::eBool,
|
|
mozilla::gfx::AttributeType::Max>
|
|
{};
|
|
|
|
template <>
|
|
struct ParamTraits<mozilla::gfx::PrimitiveType>
|
|
: public ContiguousEnumSerializer<
|
|
mozilla::gfx::PrimitiveType,
|
|
mozilla::gfx::PrimitiveType::Empty,
|
|
mozilla::gfx::PrimitiveType::Max>
|
|
{};
|
|
|
|
template <>
|
|
struct ParamTraits<mozilla::gfx::ColorSpace>
|
|
: public ContiguousEnumSerializer<
|
|
mozilla::gfx::ColorSpace,
|
|
mozilla::gfx::ColorSpace::SRGB,
|
|
mozilla::gfx::ColorSpace::Max>
|
|
{};
|
|
|
|
template <>
|
|
struct ParamTraits<mozilla::layers::TextureFlags>
|
|
: public BitFlagsEnumSerializer<
|
|
mozilla::layers::TextureFlags,
|
|
mozilla::layers::TextureFlags::ALL_BITS>
|
|
{};
|
|
|
|
template <>
|
|
struct ParamTraits<mozilla::layers::DiagnosticTypes>
|
|
: public BitFlagsEnumSerializer<
|
|
mozilla::layers::DiagnosticTypes,
|
|
mozilla::layers::DiagnosticTypes::ALL_BITS>
|
|
{};
|
|
|
|
/*
|
|
template <>
|
|
struct ParamTraits<mozilla::PixelFormat>
|
|
: public EnumSerializer<mozilla::PixelFormat,
|
|
gfxImageFormat::ARGB32,
|
|
gfxImageFormat::Unknown>
|
|
{};
|
|
*/
|
|
|
|
template<>
|
|
struct ParamTraits<mozilla::gfx::Color>
|
|
{
|
|
typedef mozilla::gfx::Color paramType;
|
|
|
|
static void Write(Message* msg, const paramType& param)
|
|
{
|
|
WriteParam(msg, param.r);
|
|
WriteParam(msg, param.g);
|
|
WriteParam(msg, param.b);
|
|
WriteParam(msg, param.a);
|
|
}
|
|
|
|
static bool Read(const Message* msg, void** iter, paramType* result)
|
|
{
|
|
return (ReadParam(msg, iter, &result->r) &&
|
|
ReadParam(msg, iter, &result->g) &&
|
|
ReadParam(msg, iter, &result->b) &&
|
|
ReadParam(msg, iter, &result->a));
|
|
}
|
|
};
|
|
|
|
template<>
|
|
struct ParamTraits<nsPoint>
|
|
{
|
|
typedef nsPoint paramType;
|
|
|
|
static void Write(Message* msg, const paramType& param)
|
|
{
|
|
WriteParam(msg, param.x);
|
|
WriteParam(msg, param.y);
|
|
}
|
|
|
|
static bool Read(const Message* msg, void** iter, paramType* result)
|
|
{
|
|
return (ReadParam(msg, iter, &result->x) &&
|
|
ReadParam(msg, iter, &result->y));
|
|
}
|
|
};
|
|
|
|
template<>
|
|
struct ParamTraits<nsIntPoint>
|
|
{
|
|
typedef nsIntPoint paramType;
|
|
|
|
static void Write(Message* msg, const paramType& param)
|
|
{
|
|
WriteParam(msg, param.x);
|
|
WriteParam(msg, param.y);
|
|
}
|
|
|
|
static bool Read(const Message* msg, void** iter, paramType* result)
|
|
{
|
|
return (ReadParam(msg, iter, &result->x) &&
|
|
ReadParam(msg, iter, &result->y));
|
|
}
|
|
};
|
|
|
|
template<typename T>
|
|
struct ParamTraits<mozilla::gfx::IntSizeTyped<T> >
|
|
{
|
|
typedef mozilla::gfx::IntSizeTyped<T> paramType;
|
|
|
|
static void Write(Message* msg, const paramType& param)
|
|
{
|
|
WriteParam(msg, param.width);
|
|
WriteParam(msg, param.height);
|
|
}
|
|
|
|
static bool Read(const Message* msg, void** iter, paramType* result)
|
|
{
|
|
return (ReadParam(msg, iter, &result->width) &&
|
|
ReadParam(msg, iter, &result->height));
|
|
}
|
|
};
|
|
|
|
template<typename Region, typename Rect, typename Iter>
|
|
struct RegionParamTraits
|
|
{
|
|
typedef Region paramType;
|
|
|
|
static void Write(Message* msg, const paramType& param)
|
|
{
|
|
Iter it(param);
|
|
while (const Rect* r = it.Next()) {
|
|
MOZ_ASSERT(!r->IsEmpty());
|
|
WriteParam(msg, *r);
|
|
}
|
|
// empty rects are sentinel values because nsRegions will never
|
|
// contain them
|
|
WriteParam(msg, Rect());
|
|
}
|
|
|
|
static bool Read(const Message* msg, void** iter, paramType* result)
|
|
{
|
|
Rect rect;
|
|
while (ReadParam(msg, iter, &rect)) {
|
|
if (rect.IsEmpty())
|
|
return true;
|
|
result->Or(*result, rect);
|
|
}
|
|
return false;
|
|
}
|
|
};
|
|
|
|
template<>
|
|
struct ParamTraits<nsIntRegion>
|
|
: RegionParamTraits<nsIntRegion, mozilla::gfx::IntRect, nsIntRegionRectIterator>
|
|
{};
|
|
|
|
template<>
|
|
struct ParamTraits<mozilla::gfx::IntSize>
|
|
{
|
|
typedef mozilla::gfx::IntSize paramType;
|
|
|
|
static void Write(Message* msg, const paramType& param)
|
|
{
|
|
WriteParam(msg, param.width);
|
|
WriteParam(msg, param.height);
|
|
}
|
|
|
|
static bool Read(const Message* msg, void** iter, paramType* result)
|
|
{
|
|
return (ReadParam(msg, iter, &result->width) &&
|
|
ReadParam(msg, iter, &result->height));
|
|
}
|
|
};
|
|
|
|
template<class T>
|
|
struct ParamTraits< mozilla::gfx::CoordTyped<T> >
|
|
{
|
|
typedef mozilla::gfx::CoordTyped<T> paramType;
|
|
|
|
static void Write(Message* msg, const paramType& param)
|
|
{
|
|
WriteParam(msg, param.value);
|
|
}
|
|
|
|
static bool Read(const Message* msg, void** iter, paramType* result)
|
|
{
|
|
return (ReadParam(msg, iter, &result->value));
|
|
}
|
|
};
|
|
|
|
template<class T>
|
|
struct ParamTraits< mozilla::gfx::IntCoordTyped<T> >
|
|
{
|
|
typedef mozilla::gfx::IntCoordTyped<T> paramType;
|
|
|
|
static void Write(Message* msg, const paramType& param)
|
|
{
|
|
WriteParam(msg, param.value);
|
|
}
|
|
|
|
static bool Read(const Message* msg, void** iter, paramType* result)
|
|
{
|
|
return (ReadParam(msg, iter, &result->value));
|
|
}
|
|
};
|
|
|
|
template<class T, class U>
|
|
struct ParamTraits< mozilla::gfx::ScaleFactor<T, U> >
|
|
{
|
|
typedef mozilla::gfx::ScaleFactor<T, U> paramType;
|
|
|
|
static void Write(Message* msg, const paramType& param)
|
|
{
|
|
WriteParam(msg, param.scale);
|
|
}
|
|
|
|
static bool Read(const Message* msg, void** iter, paramType* result)
|
|
{
|
|
return (ReadParam(msg, iter, &result->scale));
|
|
}
|
|
};
|
|
|
|
template<class T, class U>
|
|
struct ParamTraits< mozilla::gfx::ScaleFactors2D<T, U> >
|
|
{
|
|
typedef mozilla::gfx::ScaleFactors2D<T, U> paramType;
|
|
|
|
static void Write(Message* msg, const paramType& param)
|
|
{
|
|
WriteParam(msg, param.xScale);
|
|
WriteParam(msg, param.yScale);
|
|
}
|
|
|
|
static bool Read(const Message* msg, void** iter, paramType* result)
|
|
{
|
|
return (ReadParam(msg, iter, &result->xScale) &&
|
|
ReadParam(msg, iter, &result->yScale));
|
|
}
|
|
};
|
|
|
|
template<class T>
|
|
struct ParamTraits< mozilla::gfx::PointTyped<T> >
|
|
{
|
|
typedef mozilla::gfx::PointTyped<T> paramType;
|
|
|
|
static void Write(Message* msg, const paramType& param)
|
|
{
|
|
WriteParam(msg, param.x);
|
|
WriteParam(msg, param.y);
|
|
}
|
|
|
|
static bool Read(const Message* msg, void** iter, paramType* result)
|
|
{
|
|
return (ReadParam(msg, iter, &result->x) &&
|
|
ReadParam(msg, iter, &result->y));
|
|
}
|
|
};
|
|
|
|
template<class F, class T>
|
|
struct ParamTraits< mozilla::gfx::Point3DTyped<F, T> >
|
|
{
|
|
typedef mozilla::gfx::Point3DTyped<F, T> paramType;
|
|
|
|
static void Write(Message* msg, const paramType& param)
|
|
{
|
|
WriteParam(msg, param.x);
|
|
WriteParam(msg, param.y);
|
|
WriteParam(msg, param.z);
|
|
}
|
|
|
|
static bool Read(const Message* msg, void** iter, paramType* result)
|
|
{
|
|
return (ReadParam(msg, iter, &result->x) &&
|
|
ReadParam(msg, iter, &result->y) &&
|
|
ReadParam(msg, iter, &result->z));
|
|
}
|
|
};
|
|
|
|
template<class T>
|
|
struct ParamTraits< mozilla::gfx::IntPointTyped<T> >
|
|
{
|
|
typedef mozilla::gfx::IntPointTyped<T> paramType;
|
|
|
|
static void Write(Message* msg, const paramType& param)
|
|
{
|
|
WriteParam(msg, param.x);
|
|
WriteParam(msg, param.y);
|
|
}
|
|
|
|
static bool Read(const Message* msg, void** iter, paramType* result)
|
|
{
|
|
return (ReadParam(msg, iter, &result->x) &&
|
|
ReadParam(msg, iter, &result->y));
|
|
}
|
|
};
|
|
|
|
template<class T>
|
|
struct ParamTraits< mozilla::gfx::SizeTyped<T> >
|
|
{
|
|
typedef mozilla::gfx::SizeTyped<T> paramType;
|
|
|
|
static void Write(Message* msg, const paramType& param)
|
|
{
|
|
WriteParam(msg, param.width);
|
|
WriteParam(msg, param.height);
|
|
}
|
|
|
|
static bool Read(const Message* msg, void** iter, paramType* result)
|
|
{
|
|
return (ReadParam(msg, iter, &result->width) &&
|
|
ReadParam(msg, iter, &result->height));
|
|
}
|
|
};
|
|
|
|
template<class T>
|
|
struct ParamTraits< mozilla::gfx::RectTyped<T> >
|
|
{
|
|
typedef mozilla::gfx::RectTyped<T> paramType;
|
|
|
|
static void Write(Message* msg, const paramType& param)
|
|
{
|
|
WriteParam(msg, param.x);
|
|
WriteParam(msg, param.y);
|
|
WriteParam(msg, param.width);
|
|
WriteParam(msg, param.height);
|
|
}
|
|
|
|
static bool Read(const Message* msg, void** iter, paramType* result)
|
|
{
|
|
return (ReadParam(msg, iter, &result->x) &&
|
|
ReadParam(msg, iter, &result->y) &&
|
|
ReadParam(msg, iter, &result->width) &&
|
|
ReadParam(msg, iter, &result->height));
|
|
}
|
|
};
|
|
|
|
template<class T>
|
|
struct ParamTraits< mozilla::gfx::IntRectTyped<T> >
|
|
{
|
|
typedef mozilla::gfx::IntRectTyped<T> paramType;
|
|
|
|
static void Write(Message* msg, const paramType& param)
|
|
{
|
|
WriteParam(msg, param.x);
|
|
WriteParam(msg, param.y);
|
|
WriteParam(msg, param.width);
|
|
WriteParam(msg, param.height);
|
|
}
|
|
|
|
static bool Read(const Message* msg, void** iter, paramType* result)
|
|
{
|
|
return (ReadParam(msg, iter, &result->x) &&
|
|
ReadParam(msg, iter, &result->y) &&
|
|
ReadParam(msg, iter, &result->width) &&
|
|
ReadParam(msg, iter, &result->height));
|
|
}
|
|
};
|
|
|
|
template<>
|
|
struct ParamTraits<mozilla::gfx::Margin>
|
|
{
|
|
typedef mozilla::gfx::Margin paramType;
|
|
|
|
static void Write(Message* msg, const paramType& param)
|
|
{
|
|
WriteParam(msg, param.top);
|
|
WriteParam(msg, param.right);
|
|
WriteParam(msg, param.bottom);
|
|
WriteParam(msg, param.left);
|
|
}
|
|
|
|
static bool Read(const Message* msg, void** iter, paramType* result)
|
|
{
|
|
return (ReadParam(msg, iter, &result->top) &&
|
|
ReadParam(msg, iter, &result->right) &&
|
|
ReadParam(msg, iter, &result->bottom) &&
|
|
ReadParam(msg, iter, &result->left));
|
|
}
|
|
};
|
|
|
|
template<class T>
|
|
struct ParamTraits< mozilla::gfx::MarginTyped<T> >
|
|
{
|
|
typedef mozilla::gfx::MarginTyped<T> paramType;
|
|
|
|
static void Write(Message* msg, const paramType& param)
|
|
{
|
|
WriteParam(msg, param.top);
|
|
WriteParam(msg, param.right);
|
|
WriteParam(msg, param.bottom);
|
|
WriteParam(msg, param.left);
|
|
}
|
|
|
|
static bool Read(const Message* msg, void** iter, paramType* result)
|
|
{
|
|
return (ReadParam(msg, iter, &result->top) &&
|
|
ReadParam(msg, iter, &result->right) &&
|
|
ReadParam(msg, iter, &result->bottom) &&
|
|
ReadParam(msg, iter, &result->left));
|
|
}
|
|
};
|
|
|
|
template<>
|
|
struct ParamTraits<nsRect>
|
|
{
|
|
typedef nsRect paramType;
|
|
|
|
static void Write(Message* msg, const paramType& param)
|
|
{
|
|
WriteParam(msg, param.x);
|
|
WriteParam(msg, param.y);
|
|
WriteParam(msg, param.width);
|
|
WriteParam(msg, param.height);
|
|
}
|
|
|
|
static bool Read(const Message* msg, void** iter, paramType* result)
|
|
{
|
|
return (ReadParam(msg, iter, &result->x) &&
|
|
ReadParam(msg, iter, &result->y) &&
|
|
ReadParam(msg, iter, &result->width) &&
|
|
ReadParam(msg, iter, &result->height));
|
|
}
|
|
};
|
|
|
|
template<>
|
|
struct ParamTraits<nsRegion>
|
|
: RegionParamTraits<nsRegion, nsRect, nsRegionRectIterator>
|
|
{};
|
|
|
|
template <>
|
|
struct ParamTraits<mozilla::layers::FrameMetrics>
|
|
{
|
|
typedef mozilla::layers::FrameMetrics paramType;
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam)
|
|
{
|
|
WriteParam(aMsg, aParam.mScrollableRect);
|
|
WriteParam(aMsg, aParam.mViewport);
|
|
WriteParam(aMsg, aParam.mScrollOffset);
|
|
WriteParam(aMsg, aParam.mDisplayPort);
|
|
WriteParam(aMsg, aParam.mDisplayPortMargins);
|
|
WriteParam(aMsg, aParam.mUseDisplayPortMargins);
|
|
WriteParam(aMsg, aParam.mCriticalDisplayPort);
|
|
WriteParam(aMsg, aParam.mCompositionBounds);
|
|
WriteParam(aMsg, aParam.mRootCompositionSize);
|
|
WriteParam(aMsg, aParam.mScrollId);
|
|
WriteParam(aMsg, aParam.mScrollParentId);
|
|
WriteParam(aMsg, aParam.mPresShellResolution);
|
|
WriteParam(aMsg, aParam.mCumulativeResolution);
|
|
WriteParam(aMsg, aParam.mZoom);
|
|
WriteParam(aMsg, aParam.mDevPixelsPerCSSPixel);
|
|
WriteParam(aMsg, aParam.mPresShellId);
|
|
WriteParam(aMsg, aParam.mIsRootContent);
|
|
WriteParam(aMsg, aParam.mHasScrollgrab);
|
|
WriteParam(aMsg, aParam.mUpdateScrollOffset);
|
|
WriteParam(aMsg, aParam.mScrollGeneration);
|
|
WriteParam(aMsg, aParam.mExtraResolution);
|
|
WriteParam(aMsg, aParam.mBackgroundColor);
|
|
WriteParam(aMsg, aParam.mDoSmoothScroll);
|
|
WriteParam(aMsg, aParam.mSmoothScrollOffset);
|
|
WriteParam(aMsg, aParam.GetLineScrollAmount());
|
|
WriteParam(aMsg, aParam.GetPageScrollAmount());
|
|
WriteParam(aMsg, aParam.AllowVerticalScrollWithWheel());
|
|
WriteParam(aMsg, aParam.mClipRect);
|
|
WriteParam(aMsg, aParam.mMaskLayerIndex);
|
|
WriteParam(aMsg, aParam.mIsLayersIdRoot);
|
|
WriteParam(aMsg, aParam.mUsesContainerScrolling);
|
|
WriteParam(aMsg, aParam.GetContentDescription());
|
|
}
|
|
|
|
static bool ReadContentDescription(const Message* aMsg, void** aIter, paramType* aResult)
|
|
{
|
|
nsCString str;
|
|
if (!ReadParam(aMsg, aIter, &str)) {
|
|
return false;
|
|
}
|
|
aResult->SetContentDescription(str);
|
|
return true;
|
|
}
|
|
|
|
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
|
|
{
|
|
return (ReadParam(aMsg, aIter, &aResult->mScrollableRect) &&
|
|
ReadParam(aMsg, aIter, &aResult->mViewport) &&
|
|
ReadParam(aMsg, aIter, &aResult->mScrollOffset) &&
|
|
ReadParam(aMsg, aIter, &aResult->mDisplayPort) &&
|
|
ReadParam(aMsg, aIter, &aResult->mDisplayPortMargins) &&
|
|
ReadParam(aMsg, aIter, &aResult->mUseDisplayPortMargins) &&
|
|
ReadParam(aMsg, aIter, &aResult->mCriticalDisplayPort) &&
|
|
ReadParam(aMsg, aIter, &aResult->mCompositionBounds) &&
|
|
ReadParam(aMsg, aIter, &aResult->mRootCompositionSize) &&
|
|
ReadParam(aMsg, aIter, &aResult->mScrollId) &&
|
|
ReadParam(aMsg, aIter, &aResult->mScrollParentId) &&
|
|
ReadParam(aMsg, aIter, &aResult->mPresShellResolution) &&
|
|
ReadParam(aMsg, aIter, &aResult->mCumulativeResolution) &&
|
|
ReadParam(aMsg, aIter, &aResult->mZoom) &&
|
|
ReadParam(aMsg, aIter, &aResult->mDevPixelsPerCSSPixel) &&
|
|
ReadParam(aMsg, aIter, &aResult->mPresShellId) &&
|
|
ReadParam(aMsg, aIter, &aResult->mIsRootContent) &&
|
|
ReadParam(aMsg, aIter, &aResult->mHasScrollgrab) &&
|
|
ReadParam(aMsg, aIter, &aResult->mUpdateScrollOffset) &&
|
|
ReadParam(aMsg, aIter, &aResult->mScrollGeneration) &&
|
|
ReadParam(aMsg, aIter, &aResult->mExtraResolution) &&
|
|
ReadParam(aMsg, aIter, &aResult->mBackgroundColor) &&
|
|
ReadParam(aMsg, aIter, &aResult->mDoSmoothScroll) &&
|
|
ReadParam(aMsg, aIter, &aResult->mSmoothScrollOffset) &&
|
|
ReadParam(aMsg, aIter, &aResult->mLineScrollAmount) &&
|
|
ReadParam(aMsg, aIter, &aResult->mPageScrollAmount) &&
|
|
ReadParam(aMsg, aIter, &aResult->mAllowVerticalScrollWithWheel) &&
|
|
ReadParam(aMsg, aIter, &aResult->mClipRect) &&
|
|
ReadParam(aMsg, aIter, &aResult->mMaskLayerIndex) &&
|
|
ReadParam(aMsg, aIter, &aResult->mIsLayersIdRoot) &&
|
|
ReadParam(aMsg, aIter, &aResult->mUsesContainerScrolling) &&
|
|
ReadContentDescription(aMsg, aIter, aResult));
|
|
}
|
|
};
|
|
|
|
template<>
|
|
struct ParamTraits<mozilla::layers::TextureFactoryIdentifier>
|
|
{
|
|
typedef mozilla::layers::TextureFactoryIdentifier paramType;
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam)
|
|
{
|
|
WriteParam(aMsg, aParam.mParentBackend);
|
|
WriteParam(aMsg, aParam.mSupportedBlendModes.serialize());
|
|
WriteParam(aMsg, aParam.mMaxTextureSize);
|
|
WriteParam(aMsg, aParam.mSupportsTextureBlitting);
|
|
WriteParam(aMsg, aParam.mSupportsPartialUploads);
|
|
WriteParam(aMsg, aParam.mSyncHandle);
|
|
}
|
|
|
|
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
|
|
{
|
|
uint32_t supportedBlendModes = 0;
|
|
bool result = ReadParam(aMsg, aIter, &aResult->mParentBackend) &&
|
|
ReadParam(aMsg, aIter, &supportedBlendModes) &&
|
|
ReadParam(aMsg, aIter, &aResult->mMaxTextureSize) &&
|
|
ReadParam(aMsg, aIter, &aResult->mSupportsTextureBlitting) &&
|
|
ReadParam(aMsg, aIter, &aResult->mSupportsPartialUploads) &&
|
|
ReadParam(aMsg, aIter, &aResult->mSyncHandle);
|
|
aResult->mSupportedBlendModes.deserialize(supportedBlendModes);
|
|
return result;
|
|
}
|
|
};
|
|
|
|
template<>
|
|
struct ParamTraits<mozilla::layers::TextureInfo>
|
|
{
|
|
typedef mozilla::layers::TextureInfo paramType;
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam)
|
|
{
|
|
WriteParam(aMsg, aParam.mCompositableType);
|
|
WriteParam(aMsg, aParam.mTextureFlags);
|
|
}
|
|
|
|
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
|
|
{
|
|
return ReadParam(aMsg, aIter, &aResult->mCompositableType) &&
|
|
ReadParam(aMsg, aIter, &aResult->mTextureFlags);
|
|
}
|
|
};
|
|
|
|
template <>
|
|
struct ParamTraits<mozilla::layers::CompositableType>
|
|
: public ContiguousEnumSerializer<
|
|
mozilla::layers::CompositableType,
|
|
mozilla::layers::CompositableType::UNKNOWN,
|
|
mozilla::layers::CompositableType::COUNT>
|
|
{};
|
|
|
|
template <>
|
|
struct ParamTraits<mozilla::gfx::SurfaceFormat>
|
|
: public ContiguousEnumSerializer<
|
|
mozilla::gfx::SurfaceFormat,
|
|
mozilla::gfx::SurfaceFormat::B8G8R8A8,
|
|
mozilla::gfx::SurfaceFormat::UNKNOWN>
|
|
{};
|
|
|
|
template <>
|
|
struct ParamTraits<mozilla::layers::ScrollableLayerGuid>
|
|
{
|
|
typedef mozilla::layers::ScrollableLayerGuid paramType;
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam)
|
|
{
|
|
WriteParam(aMsg, aParam.mLayersId);
|
|
WriteParam(aMsg, aParam.mPresShellId);
|
|
WriteParam(aMsg, aParam.mScrollId);
|
|
}
|
|
|
|
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
|
|
{
|
|
return (ReadParam(aMsg, aIter, &aResult->mLayersId) &&
|
|
ReadParam(aMsg, aIter, &aResult->mPresShellId) &&
|
|
ReadParam(aMsg, aIter, &aResult->mScrollId));
|
|
}
|
|
};
|
|
|
|
template <>
|
|
struct ParamTraits<mozilla::layers::ZoomConstraints>
|
|
{
|
|
typedef mozilla::layers::ZoomConstraints paramType;
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam)
|
|
{
|
|
WriteParam(aMsg, aParam.mAllowZoom);
|
|
WriteParam(aMsg, aParam.mAllowDoubleTapZoom);
|
|
WriteParam(aMsg, aParam.mMinZoom);
|
|
WriteParam(aMsg, aParam.mMaxZoom);
|
|
}
|
|
|
|
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
|
|
{
|
|
return (ReadParam(aMsg, aIter, &aResult->mAllowZoom) &&
|
|
ReadParam(aMsg, aIter, &aResult->mAllowDoubleTapZoom) &&
|
|
ReadParam(aMsg, aIter, &aResult->mMinZoom) &&
|
|
ReadParam(aMsg, aIter, &aResult->mMaxZoom));
|
|
}
|
|
};
|
|
|
|
template <>
|
|
struct ParamTraits<mozilla::layers::EventRegions>
|
|
{
|
|
typedef mozilla::layers::EventRegions paramType;
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam)
|
|
{
|
|
WriteParam(aMsg, aParam.mHitRegion);
|
|
WriteParam(aMsg, aParam.mDispatchToContentHitRegion);
|
|
WriteParam(aMsg, aParam.mNoActionRegion);
|
|
WriteParam(aMsg, aParam.mHorizontalPanRegion);
|
|
WriteParam(aMsg, aParam.mVerticalPanRegion);
|
|
}
|
|
|
|
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
|
|
{
|
|
return (ReadParam(aMsg, aIter, &aResult->mHitRegion) &&
|
|
ReadParam(aMsg, aIter, &aResult->mDispatchToContentHitRegion) &&
|
|
ReadParam(aMsg, aIter, &aResult->mNoActionRegion) &&
|
|
ReadParam(aMsg, aIter, &aResult->mHorizontalPanRegion) &&
|
|
ReadParam(aMsg, aIter, &aResult->mVerticalPanRegion));
|
|
}
|
|
};
|
|
|
|
struct MessageAndAttributeMap
|
|
{
|
|
Message* msg;
|
|
const mozilla::gfx::AttributeMap& map;
|
|
};
|
|
|
|
static bool
|
|
WriteAttribute(mozilla::gfx::AttributeName aName,
|
|
mozilla::gfx::AttributeType aType,
|
|
void* aUserData)
|
|
{
|
|
MessageAndAttributeMap* msgAndMap =
|
|
static_cast<MessageAndAttributeMap*>(aUserData);
|
|
|
|
WriteParam(msgAndMap->msg, aType);
|
|
WriteParam(msgAndMap->msg, aName);
|
|
|
|
switch (aType) {
|
|
|
|
#define HANDLE_TYPE(typeName) \
|
|
case mozilla::gfx::AttributeType::e##typeName: \
|
|
WriteParam(msgAndMap->msg, msgAndMap->map.Get##typeName(aName)); \
|
|
break;
|
|
|
|
HANDLE_TYPE(Bool)
|
|
HANDLE_TYPE(Uint)
|
|
HANDLE_TYPE(Float)
|
|
HANDLE_TYPE(Size)
|
|
HANDLE_TYPE(IntSize)
|
|
HANDLE_TYPE(IntPoint)
|
|
HANDLE_TYPE(Matrix)
|
|
HANDLE_TYPE(Matrix5x4)
|
|
HANDLE_TYPE(Point3D)
|
|
HANDLE_TYPE(Color)
|
|
HANDLE_TYPE(AttributeMap)
|
|
HANDLE_TYPE(Floats)
|
|
|
|
#undef HANDLE_TYPE
|
|
|
|
default:
|
|
MOZ_CRASH("unhandled attribute type");
|
|
}
|
|
return true;
|
|
}
|
|
|
|
template <>
|
|
struct ParamTraits<mozilla::gfx::AttributeMap>
|
|
{
|
|
typedef mozilla::gfx::AttributeMap paramType;
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam)
|
|
{
|
|
WriteParam(aMsg, aParam.Count());
|
|
MessageAndAttributeMap msgAndMap = { aMsg, aParam };
|
|
aParam.EnumerateRead(WriteAttribute, &msgAndMap);
|
|
}
|
|
|
|
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
|
|
{
|
|
uint32_t count;
|
|
if (!ReadParam(aMsg, aIter, &count)) {
|
|
return false;
|
|
}
|
|
for (uint32_t i = 0; i < count; i++) {
|
|
mozilla::gfx::AttributeType type;
|
|
if (!ReadParam(aMsg, aIter, &type)) {
|
|
return false;
|
|
}
|
|
mozilla::gfx::AttributeName name;
|
|
if (!ReadParam(aMsg, aIter, &name)) {
|
|
return false;
|
|
}
|
|
switch (type) {
|
|
|
|
#define HANDLE_TYPE(type, typeName) \
|
|
case mozilla::gfx::AttributeType::e##typeName: \
|
|
{ \
|
|
type value; \
|
|
if (!ReadParam(aMsg, aIter, &value)) { \
|
|
return false; \
|
|
} \
|
|
aResult->Set(name, value); \
|
|
}
|
|
|
|
HANDLE_TYPE(bool, Bool)
|
|
HANDLE_TYPE(uint32_t, Uint)
|
|
HANDLE_TYPE(float, Float)
|
|
HANDLE_TYPE(mozilla::gfx::Size, Size)
|
|
HANDLE_TYPE(mozilla::gfx::IntSize, IntSize)
|
|
HANDLE_TYPE(mozilla::gfx::IntPoint, IntPoint)
|
|
HANDLE_TYPE(mozilla::gfx::Matrix, Matrix)
|
|
HANDLE_TYPE(mozilla::gfx::Matrix5x4, Matrix5x4)
|
|
HANDLE_TYPE(mozilla::gfx::Point3D, Point3D)
|
|
HANDLE_TYPE(mozilla::gfx::Color, Color)
|
|
HANDLE_TYPE(mozilla::gfx::AttributeMap, AttributeMap)
|
|
|
|
#undef HANDLE_TYPE
|
|
|
|
case mozilla::gfx::AttributeType::eFloats:
|
|
{
|
|
nsTArray<float> value;
|
|
if (!ReadParam(aMsg, aIter, &value)) {
|
|
return false;
|
|
}
|
|
aResult->Set(name, &value[0], value.Length());
|
|
break;
|
|
}
|
|
default:
|
|
MOZ_CRASH("unhandled attribute type");
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
};
|
|
|
|
template <>
|
|
struct ParamTraits<mozilla::gfx::FilterPrimitiveDescription>
|
|
{
|
|
typedef mozilla::gfx::FilterPrimitiveDescription paramType;
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam)
|
|
{
|
|
WriteParam(aMsg, aParam.Type());
|
|
WriteParam(aMsg, aParam.PrimitiveSubregion());
|
|
WriteParam(aMsg, aParam.FilterSpaceBounds());
|
|
WriteParam(aMsg, aParam.IsTainted());
|
|
WriteParam(aMsg, aParam.OutputColorSpace());
|
|
WriteParam(aMsg, aParam.NumberOfInputs());
|
|
for (size_t i = 0; i < aParam.NumberOfInputs(); i++) {
|
|
WriteParam(aMsg, aParam.InputPrimitiveIndex(i));
|
|
WriteParam(aMsg, aParam.InputColorSpace(i));
|
|
}
|
|
WriteParam(aMsg, aParam.Attributes());
|
|
}
|
|
|
|
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
|
|
{
|
|
mozilla::gfx::PrimitiveType type;
|
|
mozilla::gfx::IntRect primitiveSubregion;
|
|
mozilla::gfx::IntRect filterSpaceBounds;
|
|
bool isTainted = false;
|
|
mozilla::gfx::ColorSpace outputColorSpace;
|
|
size_t numberOfInputs = 0;
|
|
if (!ReadParam(aMsg, aIter, &type) ||
|
|
!ReadParam(aMsg, aIter, &primitiveSubregion) ||
|
|
!ReadParam(aMsg, aIter, &filterSpaceBounds) ||
|
|
!ReadParam(aMsg, aIter, &isTainted) ||
|
|
!ReadParam(aMsg, aIter, &outputColorSpace) ||
|
|
!ReadParam(aMsg, aIter, &numberOfInputs)) {
|
|
return false;
|
|
}
|
|
|
|
aResult->SetType(type);
|
|
aResult->SetPrimitiveSubregion(primitiveSubregion);
|
|
aResult->SetFilterSpaceBounds(filterSpaceBounds);
|
|
aResult->SetIsTainted(isTainted);
|
|
aResult->SetOutputColorSpace(outputColorSpace);
|
|
|
|
for (size_t i = 0; i < numberOfInputs; i++) {
|
|
int32_t inputPrimitiveIndex = 0;
|
|
mozilla::gfx::ColorSpace inputColorSpace;
|
|
if (!ReadParam(aMsg, aIter, &inputPrimitiveIndex) ||
|
|
!ReadParam(aMsg, aIter, &inputColorSpace)) {
|
|
return false;
|
|
}
|
|
aResult->SetInputPrimitive(i, inputPrimitiveIndex);
|
|
aResult->SetInputColorSpace(i, inputColorSpace);
|
|
}
|
|
|
|
return ReadParam(aMsg, aIter, &aResult->Attributes());
|
|
}
|
|
};
|
|
|
|
template <>
|
|
struct ParamTraits<mozilla::gfx::FilterDescription>
|
|
{
|
|
typedef mozilla::gfx::FilterDescription paramType;
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam)
|
|
{
|
|
WriteParam(aMsg, aParam.mPrimitives);
|
|
}
|
|
|
|
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
|
|
{
|
|
return (ReadParam(aMsg, aIter, &aResult->mPrimitives));
|
|
}
|
|
};
|
|
|
|
typedef mozilla::layers::GeckoContentController::APZStateChange APZStateChange;
|
|
|
|
template <>
|
|
struct ParamTraits<APZStateChange>
|
|
: public ContiguousEnumSerializer<
|
|
APZStateChange,
|
|
APZStateChange::TransformBegin,
|
|
APZStateChange::APZStateChangeSentinel>
|
|
{};
|
|
|
|
template<>
|
|
struct ParamTraits<mozilla::layers::EventRegionsOverride>
|
|
: public BitFlagsEnumSerializer<
|
|
mozilla::layers::EventRegionsOverride,
|
|
mozilla::layers::EventRegionsOverride::ALL_BITS>
|
|
{};
|
|
|
|
template<>
|
|
struct ParamTraits<mozilla::layers::AsyncDragMetrics::DragDirection>
|
|
: public ContiguousEnumSerializer<
|
|
mozilla::layers::AsyncDragMetrics::DragDirection,
|
|
mozilla::layers::AsyncDragMetrics::DragDirection::NONE,
|
|
mozilla::layers::AsyncDragMetrics::DragDirection::SENTINEL>
|
|
{};
|
|
|
|
template<>
|
|
struct ParamTraits<mozilla::layers::AsyncDragMetrics>
|
|
{
|
|
typedef mozilla::layers::AsyncDragMetrics paramType;
|
|
|
|
static void Write(Message* aMsg, const paramType& aParam)
|
|
{
|
|
WriteParam(aMsg, aParam.mViewId);
|
|
WriteParam(aMsg, aParam.mPresShellId);
|
|
WriteParam(aMsg, aParam.mDragStartSequenceNumber);
|
|
WriteParam(aMsg, aParam.mScrollbarDragOffset);
|
|
WriteParam(aMsg, aParam.mScrollTrack);
|
|
WriteParam(aMsg, aParam.mDirection);
|
|
}
|
|
|
|
static bool Read(const Message* aMsg, void** aIter, paramType* aResult)
|
|
{
|
|
return (ReadParam(aMsg, aIter, &aResult->mViewId) &&
|
|
ReadParam(aMsg, aIter, &aResult->mPresShellId) &&
|
|
ReadParam(aMsg, aIter, &aResult->mDragStartSequenceNumber) &&
|
|
ReadParam(aMsg, aIter, &aResult->mScrollbarDragOffset) &&
|
|
ReadParam(aMsg, aIter, &aResult->mScrollTrack) &&
|
|
ReadParam(aMsg, aIter, &aResult->mDirection));
|
|
}
|
|
};
|
|
|
|
} /* namespace IPC */
|
|
|
|
#endif /* __GFXMESSAGEUTILS_H__ */
|