summaryrefslogtreecommitdiff
path: root/layout/generic/nsPluginFrame.cpp
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2020-12-26 10:16:55 +0000
committerMoonchild <moonchild@palemoon.org>2020-12-26 10:16:55 +0000
commitae2a160348562dfa5361f1e68226365b240c9597 (patch)
tree8c3ee83f8a4b618942d4e215a6937af20d7a66b4 /layout/generic/nsPluginFrame.cpp
parent9f004841a248c7c17f536be77d7af67de7b3f39b (diff)
downloaduxp-ae2a160348562dfa5361f1e68226365b240c9597.tar.gz
Issue #1053 - Part 2a: Remove android from /layout (partial)
This removes android code from base, build, forms, generic, inspector, style, printing, tools and xul.
Diffstat (limited to 'layout/generic/nsPluginFrame.cpp')
-rw-r--r--layout/generic/nsPluginFrame.cpp121
1 files changed, 1 insertions, 120 deletions
diff --git a/layout/generic/nsPluginFrame.cpp b/layout/generic/nsPluginFrame.cpp
index 6e9e072e73..442f8ca262 100644
--- a/layout/generic/nsPluginFrame.cpp
+++ b/layout/generic/nsPluginFrame.cpp
@@ -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
}