Bug 1440039 - Remove nsIDOMCanvasRenderingContext2D. r=qdot
authorAdrian Wielgosik <adrian.wielgosik@gmail.com>
Wed, 21 Feb 2018 20:49:07 +0100
changeset 457236 b2e9d1ed15f439f5eb84b0ea1591321fc7913481
parent 457235 39320b74091db92d31db3802ddfc5f9a441bb527
child 457237 f5f0ac66542e7bfed4435c5a5f4a11a92d534357
push id8799
push usermtabara@mozilla.com
push dateThu, 01 Mar 2018 16:46:23 +0000
treeherdermozilla-beta@15334014dc67 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersqdot
bugs1440039
milestone60.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1440039 - Remove nsIDOMCanvasRenderingContext2D. r=qdot MozReview-Commit-ID: GY3DdHAfQK2
browser/modules/WindowsPreviewPerTab.jsm
dom/canvas/CanvasRenderingContext2D.cpp
dom/canvas/CanvasRenderingContext2D.h
dom/canvas/CanvasUtils.cpp
dom/canvas/ImageData.h
dom/interfaces/canvas/moz.build
dom/interfaces/canvas/nsIDOMCanvasRenderingContext2D.idl
xpcom/reflect/xptinfo/ShimInterfaceInfo.cpp
--- a/browser/modules/WindowsPreviewPerTab.jsm
+++ b/browser/modules/WindowsPreviewPerTab.jsm
@@ -338,25 +338,16 @@ PreviewController.prototype = {
     switch (evt.type) {
       case "TabAttrModified":
         this.updateTitleAndTooltip();
         break;
     }
   }
 };
 
-XPCOMUtils.defineLazyGetter(PreviewController.prototype, "canvasPreviewFlags",
-  function() {
- let canvasInterface = Ci.nsIDOMCanvasRenderingContext2D;
-                return canvasInterface.DRAWWINDOW_DRAW_VIEW
-                     | canvasInterface.DRAWWINDOW_DRAW_CARET
-                     | canvasInterface.DRAWWINDOW_ASYNC_DECODE_IMAGES
-                     | canvasInterface.DRAWWINDOW_DO_NOT_FLUSH;
-});
-
 // TabWindow
 
 /*
  * This class monitors a browser window for changes to its tabs
  *
  * @param win
  *        The nsIDOMWindow browser window
  */
--- a/dom/canvas/CanvasRenderingContext2D.cpp
+++ b/dom/canvas/CanvasRenderingContext2D.cpp
@@ -5557,17 +5557,17 @@ CanvasRenderingContext2D::DrawWindow(nsG
   // protect against too-large surfaces that will cause allocation
   // or overflow issues
   if (!Factory::CheckSurfaceSize(IntSize(int32_t(aW), int32_t(aH)), 0xffff)) {
     aError.Throw(NS_ERROR_FAILURE);
     return;
   }
 
   // Flush layout updates
-  if (!(aFlags & nsIDOMCanvasRenderingContext2D::DRAWWINDOW_DO_NOT_FLUSH)) {
+  if (!(aFlags & CanvasRenderingContext2DBinding::DRAWWINDOW_DO_NOT_FLUSH)) {
     nsContentUtils::FlushLayoutForTree(aWindow.AsInner()->GetOuterWindow());
   }
 
   CompositionOp op = UsedOperation();
   bool discardContent = GlobalAlpha() == 1.0f
     && (op == CompositionOp::OP_OVER || op == CompositionOp::OP_SOURCE);
   const gfx::Rect drawRect(aX, aY, aW, aH);
   EnsureTarget(discardContent ? &drawRect : nullptr);
@@ -5592,30 +5592,30 @@ CanvasRenderingContext2D::DrawWindow(nsG
   }
 
   nsRect r(nsPresContext::CSSPixelsToAppUnits((float)aX),
            nsPresContext::CSSPixelsToAppUnits((float)aY),
            nsPresContext::CSSPixelsToAppUnits((float)aW),
            nsPresContext::CSSPixelsToAppUnits((float)aH));
   uint32_t renderDocFlags = (nsIPresShell::RENDER_IGNORE_VIEWPORT_SCROLLING |
                              nsIPresShell::RENDER_DOCUMENT_RELATIVE);
-  if (aFlags & nsIDOMCanvasRenderingContext2D::DRAWWINDOW_DRAW_CARET) {
+  if (aFlags & CanvasRenderingContext2DBinding::DRAWWINDOW_DRAW_CARET) {
     renderDocFlags |= nsIPresShell::RENDER_CARET;
   }
-  if (aFlags & nsIDOMCanvasRenderingContext2D::DRAWWINDOW_DRAW_VIEW) {
+  if (aFlags & CanvasRenderingContext2DBinding::DRAWWINDOW_DRAW_VIEW) {
     renderDocFlags &= ~(nsIPresShell::RENDER_IGNORE_VIEWPORT_SCROLLING |
                         nsIPresShell::RENDER_DOCUMENT_RELATIVE);
   }
-  if (aFlags & nsIDOMCanvasRenderingContext2D::DRAWWINDOW_USE_WIDGET_LAYERS) {
+  if (aFlags & CanvasRenderingContext2DBinding::DRAWWINDOW_USE_WIDGET_LAYERS) {
     renderDocFlags |= nsIPresShell::RENDER_USE_WIDGET_LAYERS;
   }
-  if (aFlags & nsIDOMCanvasRenderingContext2D::DRAWWINDOW_ASYNC_DECODE_IMAGES) {
+  if (aFlags & CanvasRenderingContext2DBinding::DRAWWINDOW_ASYNC_DECODE_IMAGES) {
     renderDocFlags |= nsIPresShell::RENDER_ASYNC_DECODE_IMAGES;
   }
-  if (aFlags & nsIDOMCanvasRenderingContext2D::DRAWWINDOW_DO_NOT_FLUSH) {
+  if (aFlags & CanvasRenderingContext2DBinding::DRAWWINDOW_DO_NOT_FLUSH) {
     renderDocFlags |= nsIPresShell::RENDER_DRAWWINDOW_NOT_FLUSHING;
   }
 
   // gfxContext-over-Azure may modify the DrawTarget's transform, so
   // save and restore it
   Matrix matrix = mTarget->GetTransform();
   double sw = matrix._11 * aW;
   double sh = matrix._22 * aH;
--- a/dom/canvas/CanvasRenderingContext2D.h
+++ b/dom/canvas/CanvasRenderingContext2D.h
@@ -2,17 +2,16 @@
  * 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 CanvasRenderingContext2D_h
 #define CanvasRenderingContext2D_h
 
 #include "mozilla/Attributes.h"
 #include <vector>
-#include "nsIDOMCanvasRenderingContext2D.h"
 #include "nsICanvasRenderingContextInternal.h"
 #include "mozilla/RefPtr.h"
 #include "nsColor.h"
 #include "mozilla/dom/HTMLCanvasElement.h"
 #include "mozilla/dom/HTMLVideoElement.h"
 #include "gfxTextRun.h"
 #include "mozilla/ErrorResult.h"
 #include "mozilla/dom/BasicRenderingContext2D.h"
--- a/dom/canvas/CanvasUtils.cpp
+++ b/dom/canvas/CanvasUtils.cpp
@@ -4,17 +4,16 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include <stdlib.h>
 #include <stdarg.h>
 
 #include "nsIServiceManager.h"
 
 #include "nsIConsoleService.h"
-#include "nsIDOMCanvasRenderingContext2D.h"
 #include "nsICanvasRenderingContextInternal.h"
 #include "nsIHTMLCollection.h"
 #include "mozilla/dom/HTMLCanvasElement.h"
 #include "mozilla/dom/TabChild.h"
 #include "nsIPrincipal.h"
 
 #include "nsGfxCIID.h"
 
--- a/dom/canvas/ImageData.h
+++ b/dom/canvas/ImageData.h
@@ -2,18 +2,16 @@
 /* vim:set ts=2 sw=2 et tw=78: */
 /* 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 mozilla_dom_ImageData_h
 #define mozilla_dom_ImageData_h
 
-#include "nsIDOMCanvasRenderingContext2D.h"
-
 #include "mozilla/Attributes.h"
 #include "mozilla/dom/BindingUtils.h"
 #include "mozilla/dom/TypedArray.h"
 #include <stdint.h>
 
 #include "nsCycleCollectionParticipant.h"
 #include "nsISupportsImpl.h"
 #include "js/RootingAPI.h"
--- a/dom/interfaces/canvas/moz.build
+++ b/dom/interfaces/canvas/moz.build
@@ -6,14 +6,13 @@
 
 with Files("**"):
     BUG_COMPONENT = ("Core", "Canvas: 2D")
 
 with Files("nsIDOMWebGLRenderingContext.idl"):
     BUG_COMPONENT = ("Core", "Canvas: WebGL")
 
 XPIDL_SOURCES += [
-    'nsIDOMCanvasRenderingContext2D.idl',
     'nsIDOMWebGLRenderingContext.idl',
 ]
 
 XPIDL_MODULE = 'dom_canvas'
 
deleted file mode 100644
--- a/dom/interfaces/canvas/nsIDOMCanvasRenderingContext2D.idl
+++ /dev/null
@@ -1,33 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; 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/. */
-
-#include "nsISupports.idl"
-
-/**
- * This interface remains only for the constants, for a context, use the
- * WebIDL/Paris bindings instead (CanvasRenderingContext2D.webidl).
- * The constants are used by CanvasRenderingContext2D::DrawWindow and are
- * used in WindowsPreviewPerTab.jsm and some extensions. The constants can
- * be referenced directly via a canvas context 2d rather than this interface,
- * and that should be preferred in new code. 
- */
-[uuid(4417cab7-c7eb-4e0c-b00a-c43842f0cba8)]
-interface nsIDOMCanvasRenderingContext2D : nsISupports
-{
-  // Show the caret if appropriate when drawing
-  const unsigned long DRAWWINDOW_DRAW_CARET   = 0x01;
-  // Don't flush pending layout notifications that could otherwise
-  // be batched up
-  const unsigned long DRAWWINDOW_DO_NOT_FLUSH = 0x02;
-  // Draw scrollbars and scroll the viewport if they are present
-  const unsigned long DRAWWINDOW_DRAW_VIEW    = 0x04;
-  // Use the widget layer manager if available. This means hardware
-  // acceleration may be used, but it might actually be slower or
-  // lower quality than normal. It will however more accurately reflect
-  // the pixels rendered to the screen.
-  const unsigned long DRAWWINDOW_USE_WIDGET_LAYERS = 0x08;
-  // Don't synchronously decode images - draw what we have
-  const unsigned long DRAWWINDOW_ASYNC_DECODE_IMAGES = 0x10;
-};
--- a/xpcom/reflect/xptinfo/ShimInterfaceInfo.cpp
+++ b/xpcom/reflect/xptinfo/ShimInterfaceInfo.cpp
@@ -2,17 +2,16 @@
  * vim: set ts=8 sw=4 et tw=78:
  *
  * 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/. */
 
 #include "ShimInterfaceInfo.h"
 
-#include "nsIDOMCanvasRenderingContext2D.h"
 #include "nsIDOMCharacterData.h"
 #include "nsIDOMClientRect.h"
 #include "nsIDOMClientRectList.h"
 #include "nsIDOMClipboardEvent.h"
 #include "nsIDOMComment.h"
 #include "nsIDOMCustomEvent.h"
 #ifdef MOZ_WEBRTC
 #include "nsIDOMDataChannel.h"
@@ -54,17 +53,16 @@
 #include "nsIDOMXULCommandEvent.h"
 #include "nsIDOMXULElement.h"
 #include "nsIFrameLoader.h"
 #include "nsIListBoxObject.h"
 #include "nsISelection.h"
 #include "nsITreeBoxObject.h"
 #include "nsIWebBrowserPersistable.h"
 
-#include "mozilla/dom/CanvasRenderingContext2DBinding.h"
 #include "mozilla/dom/CharacterDataBinding.h"
 #include "mozilla/dom/DOMRectBinding.h"
 #include "mozilla/dom/DOMRectListBinding.h"
 #include "mozilla/dom/ClipboardEventBinding.h"
 #include "mozilla/dom/CommentBinding.h"
 #include "mozilla/dom/CSSPrimitiveValueBinding.h"
 #include "mozilla/dom/CSSStyleDeclarationBinding.h"
 #include "mozilla/dom/CSSStyleSheetBinding.h"
@@ -179,17 +177,16 @@ struct ComponentsInterfaceShimEntry {
  *   interface, and add a shim entry below.  If the name of the XPIDL
  *   interface only has an "nsIDOM" prefix prepended to the WebIDL name, you
  *   can use the DEFINE_SHIM macro and pass in the name of the WebIDL
  *   interface.  Otherwise, use DEFINE_SHIM_WITH_CUSTOM_INTERFACE.
  */
 
 const ComponentsInterfaceShimEntry kComponentsInterfaceShimMap[] =
 {
-  DEFINE_SHIM(CanvasRenderingContext2D),
   DEFINE_SHIM(CharacterData),
   DEFINE_SHIM_WITH_CUSTOM_INTERFACE(nsIDOMClientRect, DOMRectReadOnly),
   DEFINE_SHIM_WITH_CUSTOM_INTERFACE(nsIDOMClientRectList, DOMRectList),
   DEFINE_SHIM(ClipboardEvent),
   DEFINE_SHIM(Comment),
   DEFINE_SHIM(CustomEvent),
   DEFINE_SHIM(DataTransfer),
   DEFINE_SHIM(DOMCursor),