Bug 583857. Add GfxInfo service. r=roc

Add a GfxInfo service that will let our reftest framework know
if D2D is enabled or not.
This commit is contained in:
Jeff Muizelaar committed 2010-08-13 11:43:35 -04:00
1 parent dbb4c47529
commit 1270619b33
7 files changed
+172

No files matched your search

+1
View File
@@ -120,6 +120,7 @@ XPIDLSRCS += nsIPrintSettingsWin.idl \
nsITaskbarPreviewButton.idl \
nsIJumpListBuilder.idl \
nsIJumpListItem.idl \
nsIGfxInfo.idl \
$(NULL)
endif
+46
View File
@@ -0,0 +1,46 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Mozilla Communicator.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corp.
* Portions created by the Initial Developer are Copyright (C) 2000
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "nsISupports.idl"
[scriptable, uuid(5C05E5B7-0FCC-4070-BF6B-58BC33ECA427)]
interface nsIGfxInfo : nsISupports
{
readonly attribute boolean D2DEnabled;
};
+3
View File
@@ -194,3 +194,6 @@
{ 0x06beec76, 0xa183, 0x4d9f, \
{ 0x85, 0xdd, 0x08, 0x5f, 0x26, 0xda, 0x56, 0x5a } }
#define NS_GFXINFO_CID \
{ 0xd755a760, 0x9f27, 0x11df, \
{ 0x08, 0x00, 0x20, 0x0c, 0x9a, 0x66, 0x42, 0x42 } }
+10
View File
@@ -57,6 +57,7 @@
#include "WinTaskbar.h"
#include "JumpListBuilder.h"
#include "JumpListItem.h"
#include "GfxInfo.h"
// Drag & Drop, Clipboard
@@ -99,6 +100,12 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(JumpListLink)
NS_GENERIC_FACTORY_CONSTRUCTOR(JumpListShortcut)
#endif
namespace mozilla {
namespace widget {
NS_GENERIC_FACTORY_CONSTRUCTOR(GfxInfo)
}
}
NS_GENERIC_FACTORY_CONSTRUCTOR(nsTransferable)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsHTMLFormatConverter)
#ifndef WINCE
@@ -119,6 +126,7 @@ NS_DEFINE_NAMED_CID(NS_FILEPICKER_CID);
NS_DEFINE_NAMED_CID(NS_APPSHELL_CID);
NS_DEFINE_NAMED_CID(NS_TOOLKIT_CID);
NS_DEFINE_NAMED_CID(NS_SCREENMANAGER_CID);
NS_DEFINE_NAMED_CID(NS_GFXINFO_CID);
NS_DEFINE_NAMED_CID(NS_LOOKANDFEEL_CID);
NS_DEFINE_NAMED_CID(NS_THEMERENDERER_CID);
NS_DEFINE_NAMED_CID(NS_IDLE_SERVICE_CID);
@@ -154,6 +162,7 @@ static const mozilla::Module::CIDEntry kWidgetCIDs[] = {
{ &kNS_APPSHELL_CID, false, NULL, nsAppShellConstructor },
{ &kNS_TOOLKIT_CID, false, NULL, nsToolkitConstructor },
{ &kNS_SCREENMANAGER_CID, false, NULL, nsScreenManagerWinConstructor },
{ &kNS_GFXINFO_CID, false, NULL, GfxInfoConstructor },
{ &kNS_LOOKANDFEEL_CID, false, NULL, nsLookAndFeelConstructor },
{ &kNS_THEMERENDERER_CID, false, NULL, NS_NewNativeTheme },
{ &kNS_IDLE_SERVICE_CID, false, NULL, nsIdleServiceWinConstructor },
@@ -190,6 +199,7 @@ static const mozilla::Module::ContractIDEntry kWidgetContracts[] = {
{ "@mozilla.org/widget/appshell/win;1", &kNS_APPSHELL_CID },
{ "@mozilla.org/widget/toolkit/win;1", &kNS_TOOLKIT_CID },
{ "@mozilla.org/gfx/screenmanager;1", &kNS_SCREENMANAGER_CID },
{ "@mozilla.org/gfx/info;1", &kNS_GFXINFO_CID },
{ "@mozilla.org/widget/lookandfeel;1", &kNS_LOOKANDFEEL_CID },
{ "@mozilla.org/chrome/chrome-native-theme;1", &kNS_THEMERENDERER_CID },
{ "@mozilla.org/widget/idleservice;1", &kNS_IDLE_SERVICE_CID },
+49
View File
@@ -0,0 +1,49 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Mozilla Foundation.
* Portions created by the Initial Developer are Copyright (C) 2010
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "gfxWindowsPlatform.h"
#include "GfxInfo.h"
using namespace mozilla::widget;
NS_IMPL_ISUPPORTS1(GfxInfo, nsIGfxInfo)
nsresult GfxInfo::GetD2DEnabled(PRBool *aEnabled)
{
*aEnabled = gfxWindowsPlatform::GetPlatform()->GetRenderMode() == gfxWindowsPlatform::RENDER_DIRECT2D;
return NS_OK;
}
+62
View File
@@ -0,0 +1,62 @@
/* vim: se cin sw=2 ts=2 et : */
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Mozilla Foundation.
* Portions created by the Initial Developer are Copyright (C) 2010
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef __mozilla_widget_GfxInfo_h__
#define __mozilla_widget_GfxInfo_h__
#include <nsIGfxInfo.h>
namespace mozilla {
namespace widget {
class GfxInfo : public nsIGfxInfo
{
public:
GfxInfo() {}
virtual ~GfxInfo() {}
NS_DECL_ISUPPORTS
NS_DECL_NSIGFXINFO
};
} // namespace widget
} // namespace mozilla
#endif /* __mozilla_widget_GfxInfo_h__ */
+1
View File
@@ -71,6 +71,7 @@ CPPSRCS = \
TaskbarPreviewButton.cpp \
JumpListBuilder.cpp \
JumpListItem.cpp \
GfxInfo.cpp \
$(NULL)
ifdef NS_PRINTING