Changeset 248885 in webkit
- Timestamp:
- Aug 19, 2019 6:57:56 PM (5 years ago)
- Location:
- trunk/Source/WebKitLegacy/win
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKitLegacy/win/ChangeLog
r248856 r248885 1 2019-08-19 Fujii Hironori <Hironori.Fujii@sony.com> 2 3 [WinCairo][WK1] A browser window starts as an inactive window because AcceleratedCompositingContext::acceleratedCompositingAvailable creates temporary window 4 https://bugs.webkit.org/show_bug.cgi?id=200493 5 6 Reviewed by Ross Kirsling. 7 8 Reverted r179962. 9 10 * WebCoreSupport/AcceleratedCompositingContext.cpp: 11 (AcceleratedCompositingContext::acceleratedCompositingAvailable): Deleted. 12 * WebCoreSupport/AcceleratedCompositingContext.h: 13 * WebView.cpp: 14 (WebView::notifyPreferencesChanged): 15 1 16 2019-08-19 Sihui Liu <sihui_liu@apple.com> 2 17 -
trunk/Source/WebKitLegacy/win/WebCoreSupport/AcceleratedCompositingContext.cpp
r245950 r248885 30 30 #include "WebView.h" 31 31 32 #include <WebCore/DefWndProcWindowClass.h>33 32 #include <WebCore/Document.h> 34 33 #include <WebCore/Frame.h> 35 34 #include <WebCore/FrameView.h> 36 35 #include <WebCore/GraphicsLayerTextureMapper.h> 37 #include <WebCore/HWndDC.h>38 36 #include <WebCore/Page.h> 39 37 #include <WebCore/Settings.h> … … 266 264 } 267 265 268 bool AcceleratedCompositingContext::acceleratedCompositingAvailable()269 {270 const int width = 10;271 const int height = 10;272 273 // ANGLE requires Win7 or later.274 if (windowsVersion() < Windows7)275 return false;276 277 // Create test window to render texture in.278 HWND testWindow = ::CreateWindowEx(WS_EX_NOACTIVATE, defWndProcWindowClassName(), L"AcceleratedCompositingTesterWindow", WS_POPUP | WS_VISIBLE | WS_DISABLED, -width, -height, width, height, 0, 0, 0, 0);279 280 if (!testWindow)281 return false;282 283 // Create GL context.284 std::unique_ptr<WebCore::GLContext> context = GLContext::createContextForWindow(testWindow);285 286 if (!context) {287 ::DestroyWindow(testWindow);288 return false;289 }290 291 context->makeContextCurrent();292 293 std::unique_ptr<WebCore::TextureMapper> textureMapper = TextureMapperGL::create();294 295 if (!textureMapper) {296 ::DestroyWindow(testWindow);297 return false;298 }299 300 // Create texture.301 RefPtr<BitmapTexture> texture = textureMapper->createTexture();302 303 if (!texture) {304 ::DestroyWindow(testWindow);305 return false;306 }307 308 texture->reset(IntSize(width, height));309 310 // Copy bitmap data to texture.311 const int bitmapSize = width * height;312 int data[bitmapSize];313 const COLORREF colorRed = RGB(255, 0, 0);314 const COLORREF colorGreen = RGB(0, 255, 0);315 for (int i = 0; i < bitmapSize; i++)316 data[i] = colorGreen;317 IntRect targetRect(0, 0, width, height);318 IntPoint offset(0, 0);319 int bytesPerLine = width * 4;320 texture->updateContents(data, targetRect, offset, bytesPerLine);321 322 // Render texture.323 textureMapper->beginPainting();324 FloatRect rect(0, 0, width, height);325 textureMapper->drawTexture(*texture, rect);326 textureMapper->endPainting();327 328 // Set color of pixel (0, 0) to red, to make sure it is different from the bitmap color.329 HWndDC hdc(testWindow);330 ::SetPixel(hdc, 0, 0, colorRed);331 332 context->swapBuffers();333 334 // Check if pixel (0, 0) has expected color.335 COLORREF pixelColor = ::GetPixel(hdc, 0, 0);336 337 ::DestroyWindow(testWindow);338 339 return pixelColor == colorGreen;340 }341 342 266 void AcceleratedCompositingContext::scheduleLayerFlush() 343 267 { -
trunk/Source/WebKitLegacy/win/WebCoreSupport/AcceleratedCompositingContext.h
r248762 r248885 67 67 void scrollNonCompositedContents(const WebCore::IntRect& scrollRect, const WebCore::IntSize& scrollOffset); 68 68 69 static bool acceleratedCompositingAvailable();70 71 69 private: 72 70 WebView& m_webView; -
trunk/Source/WebKitLegacy/win/WebView.cpp
r248846 r248885 5478 5478 if (FAILED(hr)) 5479 5479 return hr; 5480 #if USE(TEXTURE_MAPPER_GL) 5481 static bool acceleratedCompositingAvailable = AcceleratedCompositingContext::acceleratedCompositingAvailable(); 5482 enabled = enabled && acceleratedCompositingAvailable; 5483 #elif USE(DIRECT2D) 5480 #if USE(DIRECT2D) 5484 5481 // Disable accelerated compositing for now. 5485 5482 enabled = false;
Note: See TracChangeset
for help on using the changeset viewer.