Issue #80 - De-unify dom/canvas

This commit is contained in:
wolfbeast 2020-04-18 22:00:45 +02:00 • committed by Roy Tam
commit b3d98cc078
17 changed files with 49 additions and 4 deletions

View file

@ -7,6 +7,7 @@
#include "nsAutoPtr.h" #include "nsAutoPtr.h"
#include "nsIImageLoadingContent.h" #include "nsIImageLoadingContent.h"
#include "nsExpirationTracker.h" #include "nsExpirationTracker.h"
#include "imgIContainer.h"
#include "imgIRequest.h" #include "imgIRequest.h"
#include "mozilla/dom/Element.h" #include "mozilla/dom/Element.h"
#include "nsTHashtable.h" #include "nsTHashtable.h"

View file

@ -4,6 +4,8 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "CanvasRenderingContextHelper.h" #include "CanvasRenderingContextHelper.h"
#include "CanvasUtils.h"
#include "ImageBitmapRenderingContext.h" #include "ImageBitmapRenderingContext.h"
#include "ImageEncoder.h" #include "ImageEncoder.h"
#include "mozilla/dom/CanvasRenderingContext2D.h" #include "mozilla/dom/CanvasRenderingContext2D.h"

View file

@ -5,19 +5,29 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "mozilla/dom/ImageBitmap.h" #include "mozilla/dom/ImageBitmap.h"
#include "mozilla/CheckedInt.h" #include "mozilla/CheckedInt.h"
#include "mozilla/dom/File.h" // for Blob
#include "mozilla/dom/HTMLImageElement.h"
#include "mozilla/dom/ImageBitmapBinding.h" #include "mozilla/dom/ImageBitmapBinding.h"
#include "mozilla/dom/Promise.h" #include "mozilla/dom/Promise.h"
#include "mozilla/dom/StructuredCloneTags.h" #include "mozilla/dom/StructuredCloneTags.h"
#include "mozilla/dom/UnionTypes.h" // for ArrayBufferViewOrArrayBuffer
#include "mozilla/dom/WorkerPrivate.h" #include "mozilla/dom/WorkerPrivate.h"
#include "mozilla/dom/WorkerRunnable.h" #include "mozilla/dom/WorkerRunnable.h"
#include "mozilla/gfx/2D.h" #include "CanvasRenderingContext2D.h"
#include "gfxUtils.h"
#include "ImageBitmapColorUtils.h" #include "ImageBitmapColorUtils.h"
#include "ImageBitmapUtils.h" #include "ImageBitmapUtils.h"
#include "ImageData.h"
#include "ImageLayers.h"
#include "ImageUtils.h" #include "ImageUtils.h"
#include "imgTools.h" #include "imgTools.h"
#include "libyuv.h" #include "libyuv.h"
#include "nsLayoutUtils.h"
#include "OffscreenCanvas.h"
using namespace mozilla::dom;
using namespace mozilla::gfx; using namespace mozilla::gfx;
using namespace mozilla::layers; using namespace mozilla::layers;

View file

@ -13,7 +13,9 @@
#include "mozilla/gfx/Rect.h" #include "mozilla/gfx/Rect.h"
#include "mozilla/Maybe.h" #include "mozilla/Maybe.h"
#include "mozilla/UniquePtr.h" #include "mozilla/UniquePtr.h"
#include "CanvasRenderingContextHelper.h"
#include "nsCycleCollectionParticipant.h" #include "nsCycleCollectionParticipant.h"
#include "nsIGlobalObject.h"
struct JSContext; struct JSContext;
struct JSStructuredCloneReader; struct JSStructuredCloneReader;

View file

@ -6,6 +6,9 @@
#include "ImageBitmapColorUtils.h" #include "ImageBitmapColorUtils.h"
#include "js/LegacyIntTypes.h"
#include <cmath>
namespace mozilla { namespace mozilla {
namespace dom { namespace dom {

View file

@ -4,9 +4,19 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "ImageBitmapRenderingContext.h" #include "ImageBitmapRenderingContext.h"
#include "mozilla/dom/ImageBitmapRenderingContextBinding.h" #include "mozilla/dom/ImageBitmapRenderingContextBinding.h"
#include "mozilla/gfx/2D.h"
#include "mozilla/gfx/DataSurfaceHelpers.h"
#include "ImageBitmap.h"
#include "ImageContainer.h" #include "ImageContainer.h"
#include "ImageEncoder.h"
#include "ImageLayers.h" #include "ImageLayers.h"
#include "imgIEncoder.h"
#include "Layers.h"
using namespace mozilla::gfx;
using namespace mozilla::layers;
namespace mozilla { namespace mozilla {
namespace dom { namespace dom {

View file

@ -7,6 +7,7 @@
#ifndef mozilla_dom_ImageBitmapUtils_h #ifndef mozilla_dom_ImageBitmapUtils_h
#define mozilla_dom_ImageBitmapUtils_h #define mozilla_dom_ImageBitmapUtils_h
#include "ImageBitmap.h"
#include "mozilla/UniquePtr.h" #include "mozilla/UniquePtr.h"
#include "nsTArrayForwardDeclare.h" #include "nsTArrayForwardDeclare.h"

View file

@ -6,6 +6,9 @@
#include "OffscreenCanvas.h" #include "OffscreenCanvas.h"
#include "mozilla/dom/File.h" // for Blob
#include "mozilla/dom/ImageEncoder.h"
#include "mozilla/dom/Promise.h"
#include "mozilla/dom/OffscreenCanvasBinding.h" #include "mozilla/dom/OffscreenCanvasBinding.h"
#include "mozilla/dom/WorkerPrivate.h" #include "mozilla/dom/WorkerPrivate.h"
#include "mozilla/dom/WorkerScope.h" #include "mozilla/dom/WorkerScope.h"
@ -15,10 +18,15 @@
#include "mozilla/Telemetry.h" #include "mozilla/Telemetry.h"
#include "CanvasRenderingContext2D.h" #include "CanvasRenderingContext2D.h"
#include "CanvasUtils.h" #include "CanvasUtils.h"
#include "GLContext.h"
#include "GLScreenBuffer.h" #include "GLScreenBuffer.h"
#include "ImageBitmap.h"
#include "WebGL1Context.h" #include "WebGL1Context.h"
#include "WebGL2Context.h" #include "WebGL2Context.h"
using namespace mozilla::layers;
using namespace mozilla::dom::workers;
namespace mozilla { namespace mozilla {
namespace dom { namespace dom {

View file

@ -11,6 +11,7 @@
#include "WebGLBuffer.h" #include "WebGLBuffer.h"
#include "WebGLContext.h" #include "WebGLContext.h"
#include "WebGLProgram.h" #include "WebGLProgram.h"
#include "WebGLTransformFeedback.h"
#include "WebGLUniformLocation.h" #include "WebGLUniformLocation.h"
#include "WebGLVertexArray.h" #include "WebGLVertexArray.h"
#include "WebGLVertexAttribData.h" #include "WebGLVertexAttribData.h"

View file

@ -7,6 +7,7 @@
#include "GLContext.h" #include "GLContext.h"
#include "WebGLBuffer.h" #include "WebGLBuffer.h"
#include "WebGLTransformFeedback.h"
#include "WebGLVertexArray.h" #include "WebGLVertexArray.h"
#include "mozilla/CheckedInt.h" #include "mozilla/CheckedInt.h"

View file

@ -7,6 +7,7 @@
#include "GLContext.h" #include "GLContext.h"
#include "mozilla/CheckedInt.h" #include "mozilla/CheckedInt.h"
#include "WebGL2Context.h"
#include "WebGLBuffer.h" #include "WebGLBuffer.h"
#include "WebGLFramebuffer.h" #include "WebGLFramebuffer.h"
#include "WebGLProgram.h" #include "WebGLProgram.h"

View file

@ -6,6 +6,7 @@
#include "WebGLExtensions.h" #include "WebGLExtensions.h"
#include "mozilla/dom/WebGLRenderingContextBinding.h" #include "mozilla/dom/WebGLRenderingContextBinding.h"
#include "GLContext.h"
#include "WebGLContext.h" #include "WebGLContext.h"
#include "WebGLContextUtils.h" #include "WebGLContextUtils.h"

View file

@ -15,7 +15,6 @@ namespace mozilla {
template<typename> class LinkedList; template<typename> class LinkedList;
class WebGLContext; class WebGLContext;
//// ////
// This class is a mixin for objects that are tied to a specific // This class is a mixin for objects that are tied to a specific

View file

@ -8,6 +8,7 @@
#include "mozilla/LinkedList.h" #include "mozilla/LinkedList.h"
#include "nsWrapperCache.h" #include "nsWrapperCache.h"
#include "WebGLContext.h"
#include "WebGLObjectModel.h" #include "WebGLObjectModel.h"
#include "WebGLStrongTypes.h" #include "WebGLStrongTypes.h"

View file

@ -6,8 +6,11 @@
#ifndef WEBGL_TRANSFORM_FEEDBACK_H_ #ifndef WEBGL_TRANSFORM_FEEDBACK_H_
#define WEBGL_TRANSFORM_FEEDBACK_H_ #define WEBGL_TRANSFORM_FEEDBACK_H_
#include <vector>
#include "mozilla/LinkedList.h" #include "mozilla/LinkedList.h"
#include "nsWrapperCache.h" #include "nsWrapperCache.h"
#include "WebGLBuffer.h"
#include "WebGLContext.h"
#include "WebGLObjectModel.h" #include "WebGLObjectModel.h"
namespace mozilla { namespace mozilla {

View file

@ -7,6 +7,7 @@
#define WEBGL_VERTEX_ATTRIB_DATA_H_ #define WEBGL_VERTEX_ATTRIB_DATA_H_
#include "GLDefs.h" #include "GLDefs.h"
#include "WebGLBuffer.h"
#include "WebGLObjectModel.h" #include "WebGLObjectModel.h"
namespace mozilla { namespace mozilla {

View file

@ -42,7 +42,7 @@ EXPORTS.mozilla.dom += [
] ]
# Canvas 2D and common sources # Canvas 2D and common sources
UNIFIED_SOURCES += [ SOURCES += [
'CanvasImageCache.cpp', 'CanvasImageCache.cpp',
'CanvasRenderingContext2D.cpp', 'CanvasRenderingContext2D.cpp',
'CanvasRenderingContextHelper.cpp', 'CanvasRenderingContextHelper.cpp',
@ -60,7 +60,7 @@ SOURCES += [
] ]
# WebGL Sources # WebGL Sources
UNIFIED_SOURCES += [ SOURCES += [
'TexUnpackBlob.cpp', 'TexUnpackBlob.cpp',
'WebGL1Context.cpp', 'WebGL1Context.cpp',
'WebGL1ContextUniforms.cpp', 'WebGL1ContextUniforms.cpp',