本文整理汇总了C++中COMPtr::acceleratedCompositingEnabled方法的典型用法代码示例。如果您正苦于以下问题:C++ COMPtr::acceleratedCompositingEnabled方法的具体用法?C++ COMPtr::acceleratedCompositingEnabled怎么用?C++ COMPtr::acceleratedCompositingEnabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类COMPtr
的用法示例。
在下文中一共展示了COMPtr::acceleratedCompositingEnabled方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char* argv[])
{
leakChecking = false;
_setmode(1, _O_BINARY);
_setmode(2, _O_BINARY);
initialize();
Vector<const char*> tests;
for (int i = 1; i < argc; ++i) {
if (!stricmp(argv[i], "--threaded")) {
threaded = true;
continue;
}
if (!stricmp(argv[i], "--dump-all-pixels")) {
dumpAllPixels = true;
continue;
}
if (!stricmp(argv[i], "--pixel-tests")) {
dumpPixels = true;
continue;
}
if (!stricmp(argv[i], "--complex-text")) {
forceComplexText = true;
continue;
}
if (!stricmp(argv[i], "--print-supported-features")) {
printSupportedFeatures = true;
continue;
}
tests.append(argv[i]);
}
policyDelegate = new PolicyDelegate();
sharedFrameLoadDelegate.adoptRef(new FrameLoadDelegate);
sharedUIDelegate.adoptRef(new UIDelegate);
sharedEditingDelegate.adoptRef(new EditingDelegate);
sharedResourceLoadDelegate.adoptRef(new ResourceLoadDelegate);
sharedHistoryDelegate.adoptRef(new HistoryDelegate);
// FIXME - need to make DRT pass with Windows native controls <http://bugs.webkit.org/show_bug.cgi?id=25592>
COMPtr<IWebPreferences> tmpPreferences;
if (FAILED(WebKitCreateInstance(CLSID_WebPreferences, 0, IID_IWebPreferences, reinterpret_cast<void**>(&tmpPreferences))))
return -1;
COMPtr<IWebPreferences> standardPreferences;
if (FAILED(tmpPreferences->standardPreferences(&standardPreferences)))
return -1;
COMPtr<IWebPreferencesPrivate> standardPreferencesPrivate;
if (FAILED(standardPreferences->QueryInterface(&standardPreferencesPrivate)))
return -1;
standardPreferencesPrivate->setShouldPaintNativeControls(FALSE);
standardPreferences->setJavaScriptEnabled(TRUE);
standardPreferences->setDefaultFontSize(16);
if (printSupportedFeatures) {
BOOL acceleratedCompositingAvailable;
standardPreferences->acceleratedCompositingEnabled(&acceleratedCompositingAvailable);
BOOL threeDRenderingAvailable =
#if ENABLE(3D_RENDERING)
true;
#else
false;
#endif
printf("SupportedFeatures:%s %s\n", acceleratedCompositingAvailable ? "AcceleratedCompositing" : "", threeDRenderingAvailable ? "3DRendering" : "");
return 0;
}
COMPtr<IWebView> webView(AdoptCOM, createWebViewAndOffscreenWindow(&webViewWindow));
if (!webView)
return -1;
COMPtr<IWebIconDatabase> iconDatabase;
COMPtr<IWebIconDatabase> tmpIconDatabase;
if (FAILED(WebKitCreateInstance(CLSID_WebIconDatabase, 0, IID_IWebIconDatabase, (void**)&tmpIconDatabase)))
return -1;
if (FAILED(tmpIconDatabase->sharedIconDatabase(&iconDatabase)))
return -1;
if (FAILED(webView->mainFrame(&frame)))
return -1;
#if USE(CFNETWORK)
RetainPtr<CFURLCacheRef> urlCache = sharedCFURLCache();
CFURLCacheRemoveAllCachedResponses(urlCache.get());
#endif
#ifdef _DEBUG
_CrtMemState entryToMainMemCheckpoint;
if (leakChecking)
_CrtMemCheckpoint(&entryToMainMemCheckpoint);
#endif
//.........这里部分代码省略.........
示例2: dllLauncherEntryPoint
extern "C" __declspec(dllexport) int WINAPI dllLauncherEntryPoint(int argc, const char* argv[])
{
// Cygwin calls ::SetErrorMode(SEM_FAILCRITICALERRORS), which we will inherit. This is bad for
// testing/debugging, as it causes the post-mortem debugger not to be invoked. We reset the
// error mode here to work around Cygwin's behavior. See <http://webkit.org/b/55222>.
::SetErrorMode(0);
::SetUnhandledExceptionFilter(exceptionFilter);
leakChecking = false;
_setmode(1, _O_BINARY);
_setmode(2, _O_BINARY);
initialize();
Vector<const char*> tests;
for (int i = 1; i < argc; ++i) {
if (!stricmp(argv[i], "--threaded")) {
threaded = true;
continue;
}
if (!stricmp(argv[i], "--dump-all-pixels")) {
dumpAllPixels = true;
continue;
}
if (!stricmp(argv[i], "--complex-text")) {
forceComplexText = true;
continue;
}
if (!stricmp(argv[i], "--print-supported-features")) {
printSupportedFeatures = true;
continue;
}
if (!stricmp(argv[i], "--pixel-tests")) {
dumpPixelsForAllTests = true;
continue;
}
tests.append(argv[i]);
}
policyDelegate = new PolicyDelegate();
sharedFrameLoadDelegate.adoptRef(new FrameLoadDelegate);
sharedUIDelegate.adoptRef(new UIDelegate);
sharedEditingDelegate.adoptRef(new EditingDelegate);
sharedHistoryDelegate.adoptRef(new HistoryDelegate);
// FIXME - need to make DRT pass with Windows native controls <http://bugs.webkit.org/show_bug.cgi?id=25592>
COMPtr<IWebPreferences> tmpPreferences;
if (FAILED(WebKitCreateInstance(CLSID_WebPreferences, 0, IID_IWebPreferences, reinterpret_cast<void**>(&tmpPreferences))))
return -1;
COMPtr<IWebPreferences> standardPreferences;
if (FAILED(tmpPreferences->standardPreferences(&standardPreferences)))
return -1;
COMPtr<IWebPreferencesPrivate> standardPreferencesPrivate;
if (FAILED(standardPreferences->QueryInterface(&standardPreferencesPrivate)))
return -1;
standardPreferencesPrivate->setShouldPaintNativeControls(FALSE);
standardPreferences->setJavaScriptEnabled(TRUE);
standardPreferences->setDefaultFontSize(16);
#if USE(CG)
standardPreferences->setAcceleratedCompositingEnabled(TRUE);
standardPreferences->setAVFoundationEnabled(TRUE);
#endif
standardPreferences->setContinuousSpellCheckingEnabled(TRUE);
if (printSupportedFeatures) {
BOOL acceleratedCompositingAvailable;
standardPreferences->acceleratedCompositingEnabled(&acceleratedCompositingAvailable);
#if ENABLE(3D_RENDERING)
// In theory, we could have a software-based 3D rendering implementation that we use when
// hardware-acceleration is not available. But we don't have any such software
// implementation, so 3D rendering is only available when hardware-acceleration is.
BOOL threeDRenderingAvailable = acceleratedCompositingAvailable;
#else
BOOL threeDRenderingAvailable = FALSE;
#endif
printf("SupportedFeatures:%s %s\n", acceleratedCompositingAvailable ? "AcceleratedCompositing" : "", threeDRenderingAvailable ? "3DRendering" : "");
return 0;
}
#if USE(CF)
// Set up these values before creating the WebView so that the various initializations will see these preferred values.
String path = libraryPathForDumpRenderTree();
CFPreferencesSetAppValue(WebDatabaseDirectoryDefaultsKey, WebCore::pathByAppendingComponent(path, "Databases").createCFString().get(), kCFPreferencesCurrentApplication);
CFPreferencesSetAppValue(WebStorageDirectoryDefaultsKey, WebCore::pathByAppendingComponent(path, "LocalStorage").createCFString().get(), kCFPreferencesCurrentApplication);
CFPreferencesSetAppValue(WebKitLocalCacheDefaultsKey, WebCore::pathByAppendingComponent(path, "LocalCache").createCFString().get(), kCFPreferencesCurrentApplication);
#endif
COMPtr<IWebView> webView(AdoptCOM, createWebViewAndOffscreenWindow(&webViewWindow));
if (!webView)
return -1;
//.........这里部分代码省略.........