Skip to content

Commit

Permalink
Backed out Bug 1010584, because it breaks OMTC compositing. Updated t…
Browse files Browse the repository at this point in the history
…o latest upstream
  • Loading branch information
tmeshkova committed Sep 19, 2014
1 parent bf8af85 commit 6752759
Show file tree
Hide file tree
Showing 12 changed files with 20 additions and 37 deletions.
Expand Up @@ -77,7 +77,7 @@ EmbedLiteAppThreadChild::Init(MessageChannel* aParentChannel)
Open(aParentChannel, mParentLoop, ipc::ChildSide);
RecvSetBoolPref(nsDependentCString("layers.offmainthreadcomposition.enabled"), true);

nsresult rv = InitAppService();
mozilla::DebugOnly<nsresult> rv = InitAppService();
MOZ_ASSERT(NS_SUCCEEDED(rv));

SendInitialized();
Expand Down
3 changes: 1 addition & 2 deletions embedding/embedlite/embedthread/EmbedLiteViewThreadChild.cpp
Expand Up @@ -770,8 +770,7 @@ EmbedLiteViewThreadChild::RecvHandleTextEvent(const nsString& commit, const nsSt
inputEvent.time = static_cast<uint64_t>(PR_Now() / 1000);
inputEvent.mIsComposing = mIMEComposing;
nsEventStatus status = nsEventStatus_eIgnore;
nsresult rv =
ps->HandleEventWithTarget(&inputEvent, nullptr, mTarget, &status);
ps->HandleEventWithTarget(&inputEvent, nullptr, mTarget, &status);
}

if (EndComposite) {
Expand Down
4 changes: 2 additions & 2 deletions embedding/embedlite/modules/EmbedLiteJSON.cpp
Expand Up @@ -48,7 +48,7 @@ EmbedLiteJSON::CreateObject(nsIWritablePropertyBag2 * *aObject)
}

static bool
JSONCreator(const jschar* aBuf, uint32_t aLen, void* aData)
JSONCreator(const char16_t* aBuf, uint32_t aLen, void* aData)
{
nsAString* result = static_cast<nsAString*>(aData);
result->Append(static_cast<const char16_t*>(aBuf),
Expand Down Expand Up @@ -163,7 +163,7 @@ EmbedLiteJSON::ParseJSON(nsAString const& aJson, nsIPropertyBag2** aRoot)
AutoSafeJSContext cx;
JS::Rooted<JS::Value> json(cx, JSVAL_NULL);
if (!JS_ParseJSON(cx,
static_cast<const jschar*>(aJson.BeginReading()),
static_cast<const char16_t*>(aJson.BeginReading()),
aJson.Length(),
&json)) {
NS_ERROR("Failed to parse json string");
Expand Down
1 change: 0 additions & 1 deletion embedding/embedlite/moz.build
Expand Up @@ -8,7 +8,6 @@ DIRS += ['tests']
if CONFIG['ENABLE_TESTS']:
DIRS += ['tests/gtest']

LIBRARY_NAME = 'embedlite'
FAIL_ON_WARNINGS = True

FINAL_LIBRARY = 'xul'
Expand Down
6 changes: 0 additions & 6 deletions embedding/embedlite/tests/moz.build
Expand Up @@ -12,12 +12,6 @@ DEFINES['XPCOM_GLUE'] = True

DISABLE_STL_WRAPPING = True

# SIMPLE_PROGRAMS compiles a single .cpp file into an executable
SIMPLE_PROGRAMS += [
"embedLiteCoreInitTest%s" % (CONFIG['BIN_SUFFIX']),
"embedLiteViewInitTest%s" % (CONFIG['BIN_SUFFIX']),
]

USE_LIBS += [
'xpcomglue',
]
Expand Down
7 changes: 7 additions & 0 deletions embedding/embedlite/utils/EmbedLiteXulAppInfo.cpp
Expand Up @@ -188,3 +188,10 @@ EmbedLiteXulAppInfo::GetProcessID(uint32_t* aResult)
#endif
return NS_OK;
}

NS_IMETHODIMP
EmbedLiteXulAppInfo::GetBrowserTabsRemoteAutostart(bool* aResult)
{
*aResult = BrowserTabsRemoteAutostart();
return NS_OK;
}
2 changes: 1 addition & 1 deletion embedding/embedlite/utils/TabChildHelper.cpp
Expand Up @@ -317,7 +317,7 @@ TabChildHelper::DoLoadFrameScript(const nsAString& aURL, bool aRunInGlobalScope)
}

static bool
JSONCreator(const jschar* aBuf, uint32_t aLen, void* aData)
JSONCreator(const char16_t* aBuf, uint32_t aLen, void* aData)
{
nsAString* result = static_cast<nsAString*>(aData);
result->Append(static_cast<const char16_t*>(aBuf),
Expand Down
13 changes: 3 additions & 10 deletions gfx/layers/Compositor.cpp
Expand Up @@ -105,17 +105,10 @@ Compositor::DrawDiagnostics(DiagnosticFlags aFlags,
}

RenderTargetRect
Compositor::ClipRectInLayersCoordinates(Layer* aLayer, RenderTargetIntRect aClip) const {
ContainerLayer* parent = aLayer->AsContainerLayer() ? aLayer->AsContainerLayer() : aLayer->GetParent();
while (!parent->UseIntermediateSurface() && parent->GetParent()) {
parent = parent->GetParent();
}

RenderTargetIntPoint renderTargetOffset = RenderTargetIntRect::FromUntyped(
parent->GetEffectiveVisibleRegion().GetBounds()).TopLeft();

Compositor::ClipRectInLayersCoordinates(RenderTargetIntRect aClip) const {
RenderTargetRect result;
aClip = aClip + renderTargetOffset;
aClip = aClip + RenderTargetIntPoint(GetCurrentRenderTarget()->GetOrigin().x,
GetCurrentRenderTarget()->GetOrigin().y);
result = RenderTargetRect(aClip.x, aClip.y, aClip.width, aClip.height);
return result;
}
Expand Down
2 changes: 1 addition & 1 deletion gfx/layers/Compositor.h
Expand Up @@ -494,7 +494,7 @@ class Compositor
// at the OS level rather than in Gecko.
// In addition, the clip rect needs to be offset by the rendering origin.
// This becomes important if intermediate surfaces are used.
RenderTargetRect ClipRectInLayersCoordinates(Layer* aLayer, RenderTargetIntRect aClip) const;
RenderTargetRect ClipRectInLayersCoordinates(RenderTargetIntRect aClip) const;

protected:
void DrawDiagnosticsInternal(DiagnosticFlags aFlags,
Expand Down
2 changes: 1 addition & 1 deletion gfx/layers/FrameMetrics.h
Expand Up @@ -13,7 +13,7 @@
#include "mozilla/gfx/ScaleFactor.h" // for ScaleFactor
#include "mozilla/gfx/Logging.h" // for Log
#include "gfxColor.h"
#include "nsString.h"
#include "nsStringGlue.h"

namespace IPC {
template <typename T> struct ParamTraits;
Expand Down
11 changes: 1 addition & 10 deletions gfx/layers/composite/ContainerLayerComposite.cpp
Expand Up @@ -189,16 +189,6 @@ ContainerPrepare(ContainerT* aContainer,
continue;
}

RenderTargetRect quad = layerToRender->GetLayer()->
TransformRectToRenderTarget(LayerPixel::FromUntyped(
layerToRender->GetLayer()->GetEffectiveVisibleRegion().GetBounds()));

Compositor* compositor = aManager->GetCompositor();
if (!layerToRender->GetLayer()->AsContainerLayer() &&
!quad.Intersects(compositor->ClipRectInLayersCoordinates(layerToRender->GetLayer(), clipRect))) {
continue;
}

CULLING_LOG("Preparing sublayer %p\n", layerToRender->GetLayer());

nsIntRegion savedVisibleRegion;
Expand Down Expand Up @@ -370,6 +360,7 @@ RenderIntermediate(ContainerT* aContainer,
if (!surface) {
return;
}

compositor->SetRenderTarget(surface);
// pre-render all of the layers into our temporary
RenderLayers(aContainer, aManager, RenderTargetPixel::FromUntyped(aClipRect));
Expand Down
4 changes: 2 additions & 2 deletions gfx/layers/composite/TiledContentHost.cpp
Expand Up @@ -435,8 +435,8 @@ TiledContentHost::RenderTile(const TileHost& aTile,
Rect layerQuad(screenBounds.x, screenBounds.y, screenBounds.width, screenBounds.height);
RenderTargetRect quad = RenderTargetRect::FromUnknown(aTransform.TransformBounds(layerQuad));

if (!quad.Intersects(mCompositor->ClipRectInLayersCoordinates(mLayer,
RenderTargetIntRect(aClipRect.x, aClipRect.y, aClipRect.width, aClipRect.height)))) {
if (!quad.Intersects(mCompositor->ClipRectInLayersCoordinates(
RenderTargetIntRect(aClipRect.x, aClipRect.y, aClipRect.width, aClipRect.height)))) {
return;
}

Expand Down

0 comments on commit 6752759

Please sign in to comment.