author | sotaro <sotaro.ikeda.g@gmail.com> |
Tue, 04 Jul 2017 11:56:04 +0900 | |
changeset 367208 | aba2f559df0f4a5df0a48a1de7f72dbfb79f3ab7 |
parent 367207 | 4630d37dca64531abe937f20139140e088398716 |
child 367209 | 006ce2d7356866befcc4f2d6467f0166a517a5a2 |
push id | 32125 |
push user | cbook@mozilla.com |
push date | Tue, 04 Jul 2017 08:48:50 +0000 |
treeherder | mozilla-central@fef489e8c2a1 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | kats |
bugs | 1377314 |
milestone | 56.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
|
widget/cocoa/nsChildView.h | file | annotate | diff | comparison | revisions | |
widget/cocoa/nsChildView.mm | file | annotate | diff | comparison | revisions |
--- a/widget/cocoa/nsChildView.h +++ b/widget/cocoa/nsChildView.h @@ -630,16 +630,17 @@ protected: // Compositor thread only mozilla::UniquePtr<mozilla::widget::RectTextureImage> mResizerImage; mozilla::UniquePtr<mozilla::widget::RectTextureImage> mCornerMaskImage; mozilla::UniquePtr<mozilla::widget::RectTextureImage> mTitlebarImage; mozilla::UniquePtr<mozilla::widget::RectTextureImage> mBasicCompositorImage; // Main thread + webrender only mozilla::Maybe<mozilla::wr::ImageKey> mTitlebarImageKey; + mozilla::gfx::IntSize mTitlebarImageSize; // The area of mTitlebarCGContext that has changed and needs to be // uploaded to to mTitlebarImage. Main thread only. nsIntRegion mDirtyTitlebarRegion; mozilla::ViewRegion mNonDraggableRegion; // Cached value of [mView backingScaleFactor], to avoid sending two obj-c
--- a/widget/cocoa/nsChildView.mm +++ b/widget/cocoa/nsChildView.mm @@ -2091,19 +2091,27 @@ nsChildView::AddWindowOverlayWebRenderCo CGBitmapContextGetHeight(mTitlebarCGContext)); size_t stride = CGBitmapContextGetBytesPerRow(mTitlebarCGContext); size_t titlebarCGContextDataLength = stride * size.height; gfx::SurfaceFormat format = gfx::SurfaceFormat::B8G8R8A8; wr::ByteBuffer buffer( titlebarCGContextDataLength, static_cast<uint8_t *>(CGBitmapContextGetData(mTitlebarCGContext))); + if (mTitlebarImageKey && + mTitlebarImageSize != size) { + // Delete wr::ImageKey. wr::ImageKey does not support size change. + CleanupWebRenderWindowOverlay(aWrBridge); + MOZ_ASSERT(mTitlebarImageKey.isNothing()); + } + if (!mTitlebarImageKey) { mTitlebarImageKey = Some(aWrBridge->GetNextImageKey()); aWrBridge->SendAddImage(*mTitlebarImageKey, size, stride, format, buffer); + mTitlebarImageSize = size; updatedTitlebarRegion.SetEmpty(); } if (!updatedTitlebarRegion.IsEmpty()) { aWrBridge->SendUpdateImage(*mTitlebarImageKey, size, format, buffer); } WrRect rect = wr::ToWrRect(mTitlebarRect);