Bug 1338172 part A - remove windowed plugin support from the GTK testplugin, r=jimm

MozReview-Commit-ID: 9vlarj5C59

--HG--
extra : rebase_source : 619677dca4e97ae0d869dc68c000e427825dd350
extra : source : 6209f07e1f2655b6b14c99098c89b55db6b4d5a2
This commit is contained in:
Benjamin Smedberg 2017-02-08 13:44:21 -05:00
Родитель 893ed78ef5
Коммит e16a82150d
1 изменённых файлов: 19 добавлений и 18 удалений

Просмотреть файл

@ -61,7 +61,7 @@ struct _PlatformData {
bool
pluginSupportsWindowMode()
{
return true;
return false;
}
bool
@ -141,12 +141,12 @@ pluginDrawSolid(InstanceData* instanceData, GdkDrawable* gdkWindow,
{
cairo_t* cairoWindow = gdk_cairo_create(gdkWindow);
if (!instanceData->hasWidget) {
MOZ_RELEASE_ASSERT(!instanceData->hasWidget);
NPRect* clip = &instanceData->window.clipRect;
cairo_rectangle(cairoWindow, clip->left, clip->top,
clip->right - clip->left, clip->bottom - clip->top);
cairo_clip(cairoWindow);
}
GdkRectangle windowRect = { x, y, width, height };
gdk_cairo_rectangle(cairoWindow, &windowRect);
@ -161,10 +161,10 @@ pluginDrawWindow(InstanceData* instanceData, GdkDrawable* gdkWindow,
const GdkRectangle& invalidRect)
{
NPWindow& window = instanceData->window;
// When we have a widget, window.x/y are meaningless since our
// widget is always positioned correctly and we just draw into it at 0,0
int x = instanceData->hasWidget ? 0 : window.x;
int y = instanceData->hasWidget ? 0 : window.y;
MOZ_RELEASE_ASSERT(!instanceData->hasWidget);
int x = window.x;
int y = window.y;
int width = window.width;
int height = window.height;
@ -190,12 +190,10 @@ pluginDrawWindow(InstanceData* instanceData, GdkDrawable* gdkWindow,
if (!gdkContext)
return;
if (!instanceData->hasWidget) {
NPRect* clip = &window.clipRect;
GdkRectangle gdkClip = { clip->left, clip->top, clip->right - clip->left,
clip->bottom - clip->top };
gdk_gc_set_clip_rectangle(gdkContext, &gdkClip);
}
// draw a grey background for the plugin frame
GdkColor grey;
@ -430,8 +428,10 @@ pluginHandleEvent(InstanceData* instanceData, void* event)
int32_t pluginGetEdge(InstanceData* instanceData, RectEdge edge)
{
MOZ_RELEASE_ASSERT(!instanceData->hasWidget);
if (!instanceData->hasWidget)
return NPTEST_INT32_ERROR;
GtkWidget* plug = instanceData->platformData->plug;
if (!plug)
return NPTEST_INT32_ERROR;
@ -508,6 +508,7 @@ static void intersectWithShapeRects(Display* display, Window window,
static GdkRegion* computeClipRegion(InstanceData* instanceData)
{
MOZ_RELEASE_ASSERT(!instanceData->hasWidget);
if (!instanceData->hasWidget)
return 0;