mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-03 22:38:41 +09:00
Issue #1053 - Part 2a: Remove android from /layout (partial)
This removes android code from base, build, forms, generic, inspector, style, printing, tools and xul.
This commit is contained in:
parent
b21588597c
commit
7167c960d0
43 changed files with 56 additions and 540 deletions
|
|
@ -84,11 +84,6 @@ using mozilla::DefaultXDisplay;
|
|||
#include <winuser.h>
|
||||
#endif
|
||||
|
||||
#ifdef MOZ_WIDGET_ANDROID
|
||||
#include "AndroidBridge.h"
|
||||
#include "GLContext.h"
|
||||
#endif
|
||||
|
||||
#include "mozilla/dom/TabChild.h"
|
||||
#include "ClientLayerManager.h"
|
||||
|
||||
|
|
@ -938,55 +933,6 @@ nsDisplayPluginReadback::GetBounds(nsDisplayListBuilder* aBuilder, bool* aSnap)
|
|||
return GetDisplayItemBounds(aBuilder, this, mFrame);
|
||||
}
|
||||
|
||||
#ifdef MOZ_WIDGET_ANDROID
|
||||
|
||||
class nsDisplayPluginVideo : public nsDisplayItem {
|
||||
public:
|
||||
nsDisplayPluginVideo(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame, nsNPAPIPluginInstance::VideoInfo* aVideoInfo)
|
||||
: nsDisplayItem(aBuilder, aFrame), mVideoInfo(aVideoInfo)
|
||||
{
|
||||
MOZ_COUNT_CTOR(nsDisplayPluginVideo);
|
||||
}
|
||||
#ifdef NS_BUILD_REFCNT_LOGGING
|
||||
virtual ~nsDisplayPluginVideo() {
|
||||
MOZ_COUNT_DTOR(nsDisplayPluginVideo);
|
||||
}
|
||||
#endif
|
||||
|
||||
virtual nsRect GetBounds(nsDisplayListBuilder* aBuilder,
|
||||
bool* aSnap) override;
|
||||
|
||||
NS_DISPLAY_DECL_NAME("PluginVideo", TYPE_PLUGIN_VIDEO)
|
||||
|
||||
virtual already_AddRefed<Layer> BuildLayer(nsDisplayListBuilder* aBuilder,
|
||||
LayerManager* aManager,
|
||||
const ContainerLayerParameters& aContainerParameters) override
|
||||
{
|
||||
return static_cast<nsPluginFrame*>(mFrame)->BuildLayer(aBuilder, aManager, this, aContainerParameters);
|
||||
}
|
||||
|
||||
virtual LayerState GetLayerState(nsDisplayListBuilder* aBuilder,
|
||||
LayerManager* aManager,
|
||||
const ContainerLayerParameters& aParameters) override
|
||||
{
|
||||
return LAYER_ACTIVE;
|
||||
}
|
||||
|
||||
nsNPAPIPluginInstance::VideoInfo* VideoInfo() { return mVideoInfo; }
|
||||
|
||||
private:
|
||||
nsNPAPIPluginInstance::VideoInfo* mVideoInfo;
|
||||
};
|
||||
|
||||
nsRect
|
||||
nsDisplayPluginVideo::GetBounds(nsDisplayListBuilder* aBuilder, bool* aSnap)
|
||||
{
|
||||
*aSnap = false;
|
||||
return GetDisplayItemBounds(aBuilder, this, mFrame);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
nsRect
|
||||
nsDisplayPlugin::GetBounds(nsDisplayListBuilder* aBuilder, bool* aSnap)
|
||||
{
|
||||
|
|
@ -1138,9 +1084,6 @@ nsPluginFrame::IsOpaque() const
|
|||
{
|
||||
#if defined(XP_MACOSX)
|
||||
return false;
|
||||
#elif defined(MOZ_WIDGET_ANDROID)
|
||||
// We don't know, so just assume transparent
|
||||
return false;
|
||||
#else
|
||||
|
||||
if (mInstanceOwner && mInstanceOwner->UseAsyncRendering()) {
|
||||
|
|
@ -1239,29 +1182,12 @@ nsPluginFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|||
nsDisplayItem::ForceActiveLayers()) {
|
||||
state = LAYER_ACTIVE;
|
||||
}
|
||||
// We don't need this on Android, and it just confuses things
|
||||
#if !MOZ_WIDGET_ANDROID
|
||||
if (aBuilder->IsPaintingToWindow() &&
|
||||
state == LAYER_ACTIVE &&
|
||||
IsTransparentMode()) {
|
||||
aLists.Content()->AppendNewToTop(new (aBuilder)
|
||||
nsDisplayPluginReadback(aBuilder, this));
|
||||
}
|
||||
#endif
|
||||
|
||||
#if MOZ_WIDGET_ANDROID
|
||||
if (aBuilder->IsPaintingToWindow() &&
|
||||
state == LAYER_ACTIVE) {
|
||||
|
||||
nsTArray<nsNPAPIPluginInstance::VideoInfo*> videos;
|
||||
mInstanceOwner->GetVideos(videos);
|
||||
|
||||
for (uint32_t i = 0; i < videos.Length(); i++) {
|
||||
aLists.Content()->AppendNewToTop(new (aBuilder)
|
||||
nsDisplayPluginVideo(aBuilder, this, videos[i]));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
aLists.Content()->AppendNewToTop(new (aBuilder)
|
||||
nsDisplayPlugin(aBuilder, this));
|
||||
|
|
@ -1399,10 +1325,6 @@ nsPluginFrame::GetLayerState(nsDisplayListBuilder* aBuilder,
|
|||
if (!mInstanceOwner)
|
||||
return LAYER_NONE;
|
||||
|
||||
#ifdef MOZ_WIDGET_ANDROID
|
||||
// We always want a layer on Honeycomb and later
|
||||
return LAYER_ACTIVE;
|
||||
#else
|
||||
if (mInstanceOwner->NeedsScrollImageLayer()) {
|
||||
return LAYER_ACTIVE;
|
||||
}
|
||||
|
|
@ -1412,7 +1334,6 @@ nsPluginFrame::GetLayerState(nsDisplayListBuilder* aBuilder,
|
|||
}
|
||||
|
||||
return LAYER_ACTIVE_FORCE;
|
||||
#endif
|
||||
}
|
||||
|
||||
class PluginFrameDidCompositeObserver final : public ClientLayerManager::
|
||||
|
|
@ -1529,32 +1450,6 @@ nsPluginFrame::BuildLayer(nsDisplayListBuilder* aBuilder,
|
|||
}
|
||||
lm->AddDidCompositeObserver(mDidCompositeObserver.get());
|
||||
}
|
||||
#ifdef MOZ_WIDGET_ANDROID
|
||||
} else if (aItem->GetType() == nsDisplayItem::TYPE_PLUGIN_VIDEO) {
|
||||
nsDisplayPluginVideo* videoItem = reinterpret_cast<nsDisplayPluginVideo*>(aItem);
|
||||
nsNPAPIPluginInstance::VideoInfo* videoInfo = videoItem->VideoInfo();
|
||||
|
||||
RefPtr<ImageContainer> container = mInstanceOwner->GetImageContainerForVideo(videoInfo);
|
||||
if (!container)
|
||||
return nullptr;
|
||||
|
||||
if (!layer) {
|
||||
// Initialize ImageLayer
|
||||
layer = aManager->CreateImageLayer();
|
||||
if (!layer)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
ImageLayer* imglayer = static_cast<ImageLayer*>(layer.get());
|
||||
imglayer->SetContainer(container);
|
||||
|
||||
layer->SetContentFlags(IsOpaque() ? Layer::CONTENT_OPAQUE : 0);
|
||||
|
||||
// Set the offset and size according to the video dimensions
|
||||
r.MoveBy(videoInfo->mDimensions.TopLeft());
|
||||
size.width = videoInfo->mDimensions.width;
|
||||
size.height = videoInfo->mDimensions.height;
|
||||
#endif
|
||||
} else {
|
||||
NS_ASSERTION(aItem->GetType() == nsDisplayItem::TYPE_PLUGIN_READBACK,
|
||||
"Unknown item type");
|
||||
|
|
@ -1603,20 +1498,7 @@ nsPluginFrame::PaintPlugin(nsDisplayListBuilder* aBuilder,
|
|||
nsRenderingContext& aRenderingContext,
|
||||
const nsRect& aDirtyRect, const nsRect& aPluginRect)
|
||||
{
|
||||
#if defined(MOZ_WIDGET_ANDROID)
|
||||
if (mInstanceOwner) {
|
||||
gfxRect frameGfxRect =
|
||||
PresContext()->AppUnitsToGfxUnits(aPluginRect);
|
||||
gfxRect dirtyGfxRect =
|
||||
PresContext()->AppUnitsToGfxUnits(aDirtyRect);
|
||||
|
||||
gfxContext* ctx = aRenderingContext.ThebesContext();
|
||||
|
||||
mInstanceOwner->Paint(ctx, frameGfxRect, dirtyGfxRect);
|
||||
return;
|
||||
}
|
||||
#else
|
||||
# if defined(DEBUG)
|
||||
#if defined(DEBUG)
|
||||
// On Desktop, we should have built a layer as we no longer support in-process
|
||||
// plugins or synchronous painting. We can only get here for windowed plugins
|
||||
// (which draw themselves), or via some error/unload state.
|
||||
|
|
@ -1625,7 +1507,6 @@ nsPluginFrame::PaintPlugin(nsDisplayListBuilder* aBuilder,
|
|||
mInstanceOwner->GetWindow(window);
|
||||
MOZ_ASSERT(!window || window->type == NPWindowTypeWindow);
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue