Bug 877728 - Make the screen render offset a ScreenPoint. r=BenWa

This commit is contained in:
Kartikaya Gupta 2013-06-03 10:00:02 -04:00
parent 1fa7c9cb13
commit 82a9f4437b
10 changed files with 19 additions and 19 deletions

View File

@ -257,7 +257,7 @@ public:
* Declare an offset to use when rendering layers. This will be ignored when * Declare an offset to use when rendering layers. This will be ignored when
* rendering to a target instead of the screen. * rendering to a target instead of the screen.
*/ */
virtual void SetScreenRenderOffset(const gfx::Point& aOffset) = 0; virtual void SetScreenRenderOffset(const ScreenPoint& aOffset) = 0;
/** /**
* Tell the compositor to actually draw a quad. What to do draw and how it is * Tell the compositor to actually draw a quad. What to do draw and how it is

View File

@ -83,7 +83,7 @@ public:
mCopyTarget = aTarget; mCopyTarget = aTarget;
} }
virtual void SetScreenRenderOffset(const gfx::Point& aOffset) MOZ_OVERRIDE { virtual void SetScreenRenderOffset(const ScreenPoint& aOffset) MOZ_OVERRIDE {
} }
virtual void MakeCurrent(MakeCurrentFlags aFlags = 0) { } virtual void MakeCurrent(MakeCurrentFlags aFlags = 0) { }

View File

@ -354,7 +354,7 @@ AsyncCompositionManager::ApplyAsyncContentTransformToTree(TimeStamp aCurrentFram
gfx::Rect displayPortLayersPixels(metrics.mCriticalDisplayPort.IsEmpty() ? gfx::Rect displayPortLayersPixels(metrics.mCriticalDisplayPort.IsEmpty() ?
metrics.mDisplayPort : metrics.mCriticalDisplayPort); metrics.mDisplayPort : metrics.mCriticalDisplayPort);
gfx::Margin fixedLayerMargins(0, 0, 0, 0); gfx::Margin fixedLayerMargins(0, 0, 0, 0);
gfx::Point offset(0, 0); ScreenPoint offset(0, 0);
SyncFrameMetrics(scrollOffset, treeTransform.mScale.width, metrics.mScrollableRect, SyncFrameMetrics(scrollOffset, treeTransform.mScale.width, metrics.mScrollableRect,
mLayersUpdated, displayPortLayersPixels, 1 / rootTransform.GetXScale(), mLayersUpdated, displayPortLayersPixels, 1 / rootTransform.GetXScale(),
mIsFirstPaint, fixedLayerMargins, offset); mIsFirstPaint, fixedLayerMargins, offset);
@ -435,7 +435,7 @@ AsyncCompositionManager::TransformScrollableLayer(Layer* aLayer, const gfx3DMatr
displayPort.y += scrollOffsetLayerPixels.y; displayPort.y += scrollOffsetLayerPixels.y;
gfx::Margin fixedLayerMargins(0, 0, 0, 0); gfx::Margin fixedLayerMargins(0, 0, 0, 0);
gfx::Point offset(0, 0); ScreenPoint offset(0, 0);
ScreenPoint scrollOffset(0, 0); ScreenPoint scrollOffset(0, 0);
float scaleX = 1.0, float scaleX = 1.0,
scaleY = 1.0; scaleY = 1.0;
@ -577,7 +577,7 @@ AsyncCompositionManager::SyncViewportInfo(const LayerIntRect& aDisplayPort,
ScreenPoint& aScrollOffset, ScreenPoint& aScrollOffset,
float& aScaleX, float& aScaleY, float& aScaleX, float& aScaleY,
gfx::Margin& aFixedLayerMargins, gfx::Margin& aFixedLayerMargins,
gfx::Point& aOffset) ScreenPoint& aOffset)
{ {
#ifdef MOZ_WIDGET_ANDROID #ifdef MOZ_WIDGET_ANDROID
AndroidBridge::Bridge()->SyncViewportInfo(aDisplayPort, AndroidBridge::Bridge()->SyncViewportInfo(aDisplayPort,
@ -599,7 +599,7 @@ AsyncCompositionManager::SyncFrameMetrics(const gfx::Point& aScrollOffset,
float aDisplayResolution, float aDisplayResolution,
bool aIsFirstPaint, bool aIsFirstPaint,
gfx::Margin& aFixedLayerMargins, gfx::Margin& aFixedLayerMargins,
gfx::Point& aOffset) ScreenPoint& aOffset)
{ {
#ifdef MOZ_WIDGET_ANDROID #ifdef MOZ_WIDGET_ANDROID
AndroidBridge::Bridge()->SyncFrameMetrics(aScrollOffset, aZoom, aCssPageRect, AndroidBridge::Bridge()->SyncFrameMetrics(aScrollOffset, aZoom, aCssPageRect,

View File

@ -125,7 +125,7 @@ private:
ScreenPoint& aScrollOffset, ScreenPoint& aScrollOffset,
float& aScaleX, float& aScaleY, float& aScaleX, float& aScaleY,
gfx::Margin& aFixedLayerMargins, gfx::Margin& aFixedLayerMargins,
gfx::Point& aOffset); ScreenPoint& aOffset);
void SyncFrameMetrics(const gfx::Point& aScrollOffset, void SyncFrameMetrics(const gfx::Point& aScrollOffset,
float aZoom, float aZoom,
const CSSRect& aCssPageRect, const CSSRect& aCssPageRect,
@ -134,7 +134,7 @@ private:
float aDisplayResolution, float aDisplayResolution,
bool aIsFirstPaint, bool aIsFirstPaint,
gfx::Margin& aFixedLayerMargins, gfx::Margin& aFixedLayerMargins,
gfx::Point& aOffset); ScreenPoint& aOffset);
/** /**
* Recursively applies the given translation to all top-level fixed position * Recursively applies the given translation to all top-level fixed position

View File

@ -74,7 +74,7 @@ public:
* Declare an offset to use when rendering layers. This will be ignored when * Declare an offset to use when rendering layers. This will be ignored when
* rendering to a target instead of the screen. * rendering to a target instead of the screen.
*/ */
virtual void SetScreenRenderOffset(const gfx::Point& aOffset) MOZ_OVERRIDE { virtual void SetScreenRenderOffset(const ScreenPoint& aOffset) MOZ_OVERRIDE {
if (aOffset.x || aOffset.y) { if (aOffset.x || aOffset.y) {
NS_RUNTIMEABORT("SetScreenRenderOffset not supported by CompositorD3D11."); NS_RUNTIMEABORT("SetScreenRenderOffset not supported by CompositorD3D11.");
} }

View File

@ -93,7 +93,7 @@ public:
*/ */
virtual void SetDestinationSurfaceSize(const gfx::IntSize& aSize) MOZ_OVERRIDE; virtual void SetDestinationSurfaceSize(const gfx::IntSize& aSize) MOZ_OVERRIDE;
virtual void SetScreenRenderOffset(const gfx::Point& aOffset) MOZ_OVERRIDE { virtual void SetScreenRenderOffset(const ScreenPoint& aOffset) MOZ_OVERRIDE {
mRenderOffset = aOffset; mRenderOffset = aOffset;
} }
@ -148,7 +148,7 @@ private:
/** The size of the surface we are rendering to */ /** The size of the surface we are rendering to */
nsIntSize mSurfaceSize; nsIntSize mSurfaceSize;
gfx::Point mRenderOffset; ScreenPoint mRenderOffset;
/** Helper-class used by Initialize **/ /** Helper-class used by Initialize **/
class ReadDrawFPSPref MOZ_FINAL : public nsRunnable { class ReadDrawFPSPref MOZ_FINAL : public nsRunnable {

View File

@ -2134,7 +2134,7 @@ AndroidBridge::SetPageRect(const CSSRect& aCssPageRect)
void void
AndroidBridge::SyncViewportInfo(const LayerIntRect& aDisplayPort, float aDisplayResolution, bool aLayersUpdated, AndroidBridge::SyncViewportInfo(const LayerIntRect& aDisplayPort, float aDisplayResolution, bool aLayersUpdated,
ScreenPoint& aScrollOffset, float& aScaleX, float& aScaleY, ScreenPoint& aScrollOffset, float& aScaleX, float& aScaleY,
gfx::Margin& aFixedLayerMargins, gfx::Point& aOffset) gfx::Margin& aFixedLayerMargins, ScreenPoint& aOffset)
{ {
AndroidGeckoLayerClient *client = mLayerClient; AndroidGeckoLayerClient *client = mLayerClient;
if (!client) if (!client)
@ -2147,7 +2147,7 @@ AndroidBridge::SyncViewportInfo(const LayerIntRect& aDisplayPort, float aDisplay
void AndroidBridge::SyncFrameMetrics(const gfx::Point& aScrollOffset, float aZoom, const CSSRect& aCssPageRect, void AndroidBridge::SyncFrameMetrics(const gfx::Point& aScrollOffset, float aZoom, const CSSRect& aCssPageRect,
bool aLayersUpdated, const gfx::Rect& aDisplayPort, float aDisplayResolution, bool aLayersUpdated, const gfx::Rect& aDisplayPort, float aDisplayResolution,
bool aIsFirstPaint, gfx::Margin& aFixedLayerMargins, gfx::Point& aOffset) bool aIsFirstPaint, gfx::Margin& aFixedLayerMargins, ScreenPoint& aOffset)
{ {
AndroidGeckoLayerClient *client = mLayerClient; AndroidGeckoLayerClient *client = mLayerClient;
if (!client) if (!client)

View File

@ -375,10 +375,10 @@ public:
void SetPageRect(const CSSRect& aCssPageRect); void SetPageRect(const CSSRect& aCssPageRect);
void SyncViewportInfo(const LayerIntRect& aDisplayPort, float aDisplayResolution, bool aLayersUpdated, void SyncViewportInfo(const LayerIntRect& aDisplayPort, float aDisplayResolution, bool aLayersUpdated,
ScreenPoint& aScrollOffset, float& aScaleX, float& aScaleY, ScreenPoint& aScrollOffset, float& aScaleX, float& aScaleY,
gfx::Margin& aFixedLayerMargins, gfx::Point& aOffset); gfx::Margin& aFixedLayerMargins, ScreenPoint& aOffset);
void SyncFrameMetrics(const gfx::Point& aScrollOffset, float aZoom, const CSSRect& aCssPageRect, void SyncFrameMetrics(const gfx::Point& aScrollOffset, float aZoom, const CSSRect& aCssPageRect,
bool aLayersUpdated, const gfx::Rect& aDisplayPort, float aDisplayResolution, bool aLayersUpdated, const gfx::Rect& aDisplayPort, float aDisplayResolution,
bool aIsFirstPaint, gfx::Margin& aFixedLayerMargins, gfx::Point& aOffset); bool aIsFirstPaint, gfx::Margin& aFixedLayerMargins, ScreenPoint& aOffset);
void AddPluginView(jobject view, const gfxRect& rect, bool isFullScreen); void AddPluginView(jobject view, const gfxRect& rect, bool isFullScreen);
void RemovePluginView(jobject view, bool isFullScreen); void RemovePluginView(jobject view, bool isFullScreen);

View File

@ -892,7 +892,7 @@ AndroidGeckoLayerClient::SetPageRect(const CSSRect& aCssPageRect)
void void
AndroidGeckoLayerClient::SyncViewportInfo(const LayerIntRect& aDisplayPort, float aDisplayResolution, bool aLayersUpdated, AndroidGeckoLayerClient::SyncViewportInfo(const LayerIntRect& aDisplayPort, float aDisplayResolution, bool aLayersUpdated,
ScreenPoint& aScrollOffset, float& aScaleX, float& aScaleY, ScreenPoint& aScrollOffset, float& aScaleX, float& aScaleY,
gfx::Margin& aFixedLayerMargins, gfx::Point& aOffset) gfx::Margin& aFixedLayerMargins, ScreenPoint& aOffset)
{ {
NS_ASSERTION(!isNull(), "SyncViewportInfo called on null layer client!"); NS_ASSERTION(!isNull(), "SyncViewportInfo called on null layer client!");
JNIEnv *env = GetJNIForThread(); // this is called on the compositor thread JNIEnv *env = GetJNIForThread(); // this is called on the compositor thread
@ -924,7 +924,7 @@ AndroidGeckoLayerClient::SyncViewportInfo(const LayerIntRect& aDisplayPort, floa
void void
AndroidGeckoLayerClient::SyncFrameMetrics(const gfx::Point& aScrollOffset, float aZoom, const CSSRect& aCssPageRect, AndroidGeckoLayerClient::SyncFrameMetrics(const gfx::Point& aScrollOffset, float aZoom, const CSSRect& aCssPageRect,
bool aLayersUpdated, const gfx::Rect& aDisplayPort, float aDisplayResolution, bool aLayersUpdated, const gfx::Rect& aDisplayPort, float aDisplayResolution,
bool aIsFirstPaint, gfx::Margin& aFixedLayerMargins, gfx::Point& aOffset) bool aIsFirstPaint, gfx::Margin& aFixedLayerMargins, ScreenPoint& aOffset)
{ {
NS_ASSERTION(!isNull(), "SyncFrameMetrics called on null layer client!"); NS_ASSERTION(!isNull(), "SyncFrameMetrics called on null layer client!");
JNIEnv *env = GetJNIForThread(); // this is called on the compositor thread JNIEnv *env = GetJNIForThread(); // this is called on the compositor thread

View File

@ -273,10 +273,10 @@ public:
void SetPageRect(const CSSRect& aCssPageRect); void SetPageRect(const CSSRect& aCssPageRect);
void SyncViewportInfo(const LayerIntRect& aDisplayPort, float aDisplayResolution, bool aLayersUpdated, void SyncViewportInfo(const LayerIntRect& aDisplayPort, float aDisplayResolution, bool aLayersUpdated,
ScreenPoint& aScrollOffset, float& aScaleX, float& aScaleY, ScreenPoint& aScrollOffset, float& aScaleX, float& aScaleY,
gfx::Margin& aFixedLayerMargins, gfx::Point& aOffset); gfx::Margin& aFixedLayerMargins, ScreenPoint& aOffset);
void SyncFrameMetrics(const gfx::Point& aScrollOffset, float aZoom, const CSSRect& aCssPageRect, void SyncFrameMetrics(const gfx::Point& aScrollOffset, float aZoom, const CSSRect& aCssPageRect,
bool aLayersUpdated, const gfx::Rect& aDisplayPort, float aDisplayResolution, bool aLayersUpdated, const gfx::Rect& aDisplayPort, float aDisplayResolution,
bool aIsFirstPaint, gfx::Margin& aFixedLayerMargins, gfx::Point& aOffset); bool aIsFirstPaint, gfx::Margin& aFixedLayerMargins, ScreenPoint& aOffset);
bool ProgressiveUpdateCallback(bool aHasPendingNewThebesContent, const gfx::Rect& aDisplayPort, float aDisplayResolution, bool aDrawingCritical, gfx::Rect& aViewport, float& aScaleX, float& aScaleY); bool ProgressiveUpdateCallback(bool aHasPendingNewThebesContent, const gfx::Rect& aDisplayPort, float aDisplayResolution, bool aDrawingCritical, gfx::Rect& aViewport, float& aScaleX, float& aScaleY);
bool CreateFrame(AutoLocalJNIFrame *jniFrame, AndroidLayerRendererFrame& aFrame); bool CreateFrame(AutoLocalJNIFrame *jniFrame, AndroidLayerRendererFrame& aFrame);
bool ActivateProgram(AutoLocalJNIFrame *jniFrame); bool ActivateProgram(AutoLocalJNIFrame *jniFrame);