Skip to content

Commit

Permalink
Merge branch 'embedlite' into embedlite_upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
tmeshkova committed Jan 22, 2014
2 parents 656c8bc + 2cd6d75 commit 6f6272e
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 15 deletions.
7 changes: 4 additions & 3 deletions embedding/embedlite/PEmbedLiteView.ipdl
Expand Up @@ -15,6 +15,7 @@ using struct nsIntSize from "nsSize.h";
using struct gfxPoint from "gfxPoint.h";
using struct nsIntPoint from "nsPoint.h";
using struct mozilla::layers::FrameMetrics from "FrameMetrics.h";
using struct mozilla::layers::ScrollableLayerGuid from "FrameMetrics.h";
using FrameMetrics::ViewID from "FrameMetrics.h";
using nscolor from "nsColor.h";
using class mozilla::WidgetKeyboardEvent from "ipc/nsGUIEventIPC.h";
Expand Down Expand Up @@ -53,10 +54,10 @@ child:
int32_t aButton, int32_t aClickCount,
int32_t aModifiers, bool aIgnoreRootScrollFrame);

InputDataTouchEvent(MultiTouchInput event);
InputDataTouchEvent(ScrollableLayerGuid aGuid, MultiTouchInput event);
// We use a separate message for touchmove events only to apply
// compression to them.
InputDataTouchMoveEvent(MultiTouchInput event) compress;
InputDataTouchMoveEvent(ScrollableLayerGuid aGuid, MultiTouchInput event) compress;
AddMessageListener(nsCString name);
RemoveMessageListener(nsCString name);
AddMessageListeners(nsString [] messageNames);
Expand All @@ -82,7 +83,7 @@ parent:

ZoomToRect(CSSRect aRect);
async SetBackgroundColor(nscolor color);
ContentReceivedTouch(bool aPreventDefault);
ContentReceivedTouch(ScrollableLayerGuid aGuid, bool aPreventDefault);
sync GetGLViewSize()
returns (gfxSize aSize);

Expand Down
8 changes: 4 additions & 4 deletions embedding/embedlite/embedthread/EmbedLiteViewThreadChild.cpp
Expand Up @@ -780,7 +780,7 @@ EmbedLiteViewThreadChild::RecvMouseEvent(const nsString& aType,
}

bool
EmbedLiteViewThreadChild::RecvInputDataTouchEvent(const mozilla::MultiTouchInput& aData)
EmbedLiteViewThreadChild::RecvInputDataTouchEvent(const ScrollableLayerGuid& aGuid, const mozilla::MultiTouchInput& aData)
{
WidgetTouchEvent localEvent;
if (mHelper->ConvertMutiTouchInputToEvent(aData, localEvent)) {
Expand All @@ -789,7 +789,7 @@ EmbedLiteViewThreadChild::RecvInputDataTouchEvent(const mozilla::MultiTouchInput
nsCOMPtr<nsPIDOMWindow> outerWindow = do_GetInterface(mWebNavigation);
nsCOMPtr<nsPIDOMWindow> innerWindow = outerWindow->GetCurrentInnerWindow();
if (innerWindow && innerWindow->HasTouchEventListeners()) {
SendContentReceivedTouch(nsIPresShell::gPreventMouseEvents);
SendContentReceivedTouch(aGuid, nsIPresShell::gPreventMouseEvents);
}
static bool sDispatchMouseEvents;
static bool sDispatchMouseEventsCached = false;
Expand All @@ -815,9 +815,9 @@ EmbedLiteViewThreadChild::RecvInputDataTouchEvent(const mozilla::MultiTouchInput
}

bool
EmbedLiteViewThreadChild::RecvInputDataTouchMoveEvent(const mozilla::MultiTouchInput& aData)
EmbedLiteViewThreadChild::RecvInputDataTouchMoveEvent(const ScrollableLayerGuid& aGuid, const mozilla::MultiTouchInput& aData)
{
return RecvInputDataTouchEvent(aData);
return RecvInputDataTouchEvent(aGuid, aData);
}

NS_IMETHODIMP
Expand Down
4 changes: 2 additions & 2 deletions embedding/embedlite/embedthread/EmbedLiteViewThreadChild.h
Expand Up @@ -91,8 +91,8 @@ class EmbedLiteViewThreadChild : public PEmbedLiteViewChild,
virtual bool RecvHandleTextEvent(const nsString& commit, const nsString& preEdit);
virtual bool RecvHandleKeyPressEvent(const int& domKeyCode, const int& gmodifiers, const int& charCode);
virtual bool RecvHandleKeyReleaseEvent(const int& domKeyCode, const int& gmodifiers, const int& charCode);
virtual bool RecvInputDataTouchEvent(const mozilla::MultiTouchInput&);
virtual bool RecvInputDataTouchMoveEvent(const mozilla::MultiTouchInput&);
virtual bool RecvInputDataTouchEvent(const ScrollableLayerGuid& aGuid, const mozilla::MultiTouchInput&);
virtual bool RecvInputDataTouchMoveEvent(const ScrollableLayerGuid& aGuid, const mozilla::MultiTouchInput&);

virtual bool
RecvAddMessageListener(const nsCString&);
Expand Down
8 changes: 4 additions & 4 deletions embedding/embedlite/embedthread/EmbedLiteViewThreadParent.cpp
Expand Up @@ -281,10 +281,10 @@ EmbedLiteViewThreadParent::RecvZoomToRect(const CSSRect& aRect)
}

bool
EmbedLiteViewThreadParent::RecvContentReceivedTouch(const bool& aPreventDefault)
EmbedLiteViewThreadParent::RecvContentReceivedTouch(const ScrollableLayerGuid& aGuid, const bool& aPreventDefault)
{
if (mController) {
mController->GetManager()->ContentReceivedTouch(ScrollableLayerGuid(mRootLayerTreeId, 0, 0), aPreventDefault);
mController->GetManager()->ContentReceivedTouch(aGuid, aPreventDefault);
}
return true;
}
Expand Down Expand Up @@ -569,9 +569,9 @@ EmbedLiteViewThreadParent::ReceiveInputEvent(const InputData& aEvent)
translatedEvent.mTouches.AppendElement(newData);
}
if (multiTouchInput.mType == MultiTouchInput::MULTITOUCH_MOVE) {
unused << SendInputDataTouchMoveEvent(translatedEvent);
unused << SendInputDataTouchMoveEvent(guid, translatedEvent);
} else {
unused << SendInputDataTouchEvent(translatedEvent);
unused << SendInputDataTouchEvent(guid, translatedEvent);
}
}
}
Expand Down
Expand Up @@ -115,7 +115,7 @@ class EmbedLiteViewThreadParent : public PEmbedLiteViewParent,
RecvUpdateZoomConstraints(const bool&, const float&, const float&);
virtual bool RecvZoomToRect(const CSSRect& aRect);
virtual bool RecvSetBackgroundColor(const nscolor& aColor);
virtual bool RecvContentReceivedTouch(const bool& aPreventDefault);
virtual bool RecvContentReceivedTouch(const ScrollableLayerGuid& aGuid, const bool& aPreventDefault);

// IME
virtual bool RecvGetInputContext(int32_t* aIMEEnabled,
Expand Down
7 changes: 6 additions & 1 deletion embedding/embedlite/modules/EmbedLiteAppService.cpp
Expand Up @@ -32,10 +32,15 @@
#include "xpcprivate.h"
#include "nsPIDOMWindow.h"
#include "mozilla/AutoRestore.h"
#include "FrameMetrics.h"

using namespace mozilla;
using namespace mozilla::embedlite;

using namespace mozilla::gfx;
using namespace mozilla::layers;
using namespace mozilla::widget;

namespace
{
class AsyncArrayRemove : public nsRunnable
Expand Down Expand Up @@ -280,7 +285,7 @@ EmbedLiteAppService::ContentReceivedTouch(uint32_t aWinId, bool aPreventDefault)
{
EmbedLiteViewThreadChild* view = sGetViewById(aWinId);
NS_ENSURE_TRUE(view, NS_ERROR_FAILURE);
view->SendContentReceivedTouch(aPreventDefault);
view->SendContentReceivedTouch(ScrollableLayerGuid(0, 0, 0), aPreventDefault);
return NS_OK;
}

Expand Down
1 change: 1 addition & 0 deletions gfx/2d/Factory.cpp
Expand Up @@ -337,6 +337,7 @@ Factory::CreateDrawTargetForData(BackendType aBackend,
newTarget = new DrawTargetSkia();
newTarget->Init(aData, aSize, aStride, aFormat);
retVal = newTarget;
break;
}
#endif
#ifdef XP_MACOSX
Expand Down

0 comments on commit 6f6272e

Please sign in to comment.