Bug 997014 - Part 4: Remove the external canvas API. r=roc

This commit is contained in:
Matt Woodrow 2014-04-17 17:31:12 +12:00
Родитель 92ab7629d8
Коммит b67c6c7a20
4 изменённых файлов: 1 добавлений и 86 удалений

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

@ -11,7 +11,6 @@ XPIDL_SOURCES += [
XPIDL_MODULE = 'content_canvas'
EXPORTS += [
'nsICanvasElementExternal.h',
'nsICanvasRenderingContextInternal.h',
]

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

@ -1,58 +0,0 @@
/* -*- Mode: C++; tab-width: 40; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef nsICanvasElementExternal_h___
#define nsICanvasElementExternal_h___
#include "nsISupports.h"
#include "GraphicsFilter.h"
class gfxContext;
class nsIFrame;
struct gfxRect;
#define NS_ICANVASELEMENTEXTERNAL_IID \
{ 0x51870f54, 0x6c4c, 0x469a, {0xad, 0x46, 0xf0, 0xa9, 0x8e, 0x32, 0xa7, 0xe2 } }
class nsRenderingContext;
class nsICanvasRenderingContextInternal;
struct _cairo_surface;
/*
* This interface contains methods that are needed outside of the content/layout
* modules, specifically widget. It should eventually go away when we support
* libxul builds, and HTMLCanvasElement be used directly.
*
* Code internal to content/layout should /never/ use this interface; if the
* same functionality is needed in both places, two separate methods should be
* used.
*/
class nsICanvasElementExternal : public nsISupports {
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_ICANVASELEMENTEXTERNAL_IID)
enum {
RenderFlagPremultAlpha = 0x1
};
/**
* Get the size in pixels of this canvas element
*/
NS_IMETHOD_(nsIntSize) GetSizeExternal() = 0;
/*
* Ask the canvas element to tell the contexts to render themselves
* to the given gfxContext at the origin of its coordinate space.
*/
NS_IMETHOD RenderContextsExternal(gfxContext *ctx,
GraphicsFilter aFilter,
uint32_t aFlags = RenderFlagPremultAlpha) = 0;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsICanvasElementExternal, NS_ICANVASELEMENTEXTERNAL_IID)
#endif /* nsICanvasElementExternal_h___ */

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

@ -13,7 +13,6 @@
#include "nsSize.h"
#include "nsError.h"
#include "nsICanvasElementExternal.h"
#include "mozilla/gfx/Rect.h"
class nsICanvasRenderingContextInternal;
@ -37,7 +36,6 @@ class HTMLCanvasPrintState;
class PrintCallback;
class HTMLCanvasElement MOZ_FINAL : public nsGenericHTMLElement,
public nsICanvasElementExternal,
public nsIDOMHTMLCanvasElement
{
enum {
@ -162,13 +160,6 @@ public:
*/
bool GetIsOpaque();
/*
* nsICanvasElementExternal -- for use outside of content/layout
*/
NS_IMETHOD_(nsIntSize) GetSizeExternal() MOZ_OVERRIDE;
NS_IMETHOD RenderContextsExternal(gfxContext *aContext,
GraphicsFilter aFilter,
uint32_t aFlags = RenderFlagPremultAlpha) MOZ_OVERRIDE;
virtual TemporaryRef<gfx::SourceSurface> GetSurfaceSnapshot(bool* aPremultAlpha = nullptr);
virtual bool ParseAttribute(int32_t aNamespaceID,

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

@ -131,9 +131,7 @@ NS_IMPL_ADDREF_INHERITED(HTMLCanvasElement, Element)
NS_IMPL_RELEASE_INHERITED(HTMLCanvasElement, Element)
NS_INTERFACE_TABLE_HEAD_CYCLE_COLLECTION_INHERITED(HTMLCanvasElement)
NS_INTERFACE_TABLE_INHERITED2(HTMLCanvasElement,
nsIDOMHTMLCanvasElement,
nsICanvasElementExternal)
NS_INTERFACE_TABLE_INHERITED1(HTMLCanvasElement, nsIDOMHTMLCanvasElement)
NS_INTERFACE_TABLE_TAIL_INHERITING(nsGenericHTMLElement)
NS_IMPL_ELEMENT_CLONE(HTMLCanvasElement)
@ -935,21 +933,6 @@ HTMLCanvasElement::MarkContextClean()
mCurrentContext->MarkContextClean();
}
NS_IMETHODIMP_(nsIntSize)
HTMLCanvasElement::GetSizeExternal()
{
return GetWidthHeight();
}
NS_IMETHODIMP
HTMLCanvasElement::RenderContextsExternal(gfxContext *aContext, GraphicsFilter aFilter, uint32_t aFlags)
{
if (!mCurrentContext)
return NS_OK;
return mCurrentContext->Render(aContext, aFilter, aFlags);
}
TemporaryRef<SourceSurface>
HTMLCanvasElement::GetSurfaceSnapshot(bool* aPremultAlpha)
{