Files
palemoon27/gfx/layers/TextureWrapperImage.cpp
T
roytam1 f4385096ea import changes from `dev' branch of rmottola/Arctic-Fox:
- Bug 1016035 - Add nsIWidget::ReportSwipeStart and call it after processing wheel events that can trigger swipes. r=kats (77a6561f85)
- Bug 1221913 - Make swiping work correctly in e10s mode even if APZ is off. r=kats (5bcdc76646)
- Bug 1227020 - Replace nsBaseHashtable::Enumerate() calls in widget/ with iterators. r=roc. (a77fcf4809)
- Bug 1230047 (part 1) - Make SynthesizeNativeTouch{Point,Tap}() take ScreenIntPoints. r=kats. (bc964eb41f)
- Bug 1182543 - Use channel->ascynOpen2 in dom/plugins/base/nsPluginHost.cpp - simplifications in instanceowner (r=sicking) (e8a95bc56a)
- Revive NPAPI async drawing: stub code. (bug 1217665 part 1, r=aklotz) (81467630ee)
- Revive test plugin changes for async plugin surfaces. (bug 1217665 part 2, r=aklotz) (86eabc862c)
- Disable async rendering paths when a plugin is using direct drawing. (bug 1217665 part 3, r=aklotz) (4b53467f3f)
- Add a new Image class that wraps drawable TextureClients. (bug 1217665 part 4, r=nical) (ab131811ba)
2023-04-07 12:13:51 +08:00

54 lines
1.2 KiB
C++

/* -*- Mode: C++; tab-width: 20; 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 "TextureWrapperImage.h"
namespace mozilla {
namespace layers {
using namespace mozilla::gfx;
TextureWrapperImage::TextureWrapperImage(TextureClient* aClient, const IntRect& aPictureRect)
: Image(nullptr, ImageFormat::TEXTURE_WRAPPER),
mPictureRect(aPictureRect),
mTextureClient(aClient)
{
}
TextureWrapperImage::~TextureWrapperImage()
{
}
gfx::IntSize
TextureWrapperImage::GetSize()
{
return mTextureClient->GetSize();
}
gfx::IntRect
TextureWrapperImage::GetPictureRect()
{
return mPictureRect;
}
already_AddRefed<gfx::SourceSurface>
TextureWrapperImage::GetAsSourceSurface()
{
TextureClientAutoLock autoLock(mTextureClient, OpenMode::OPEN_READ);
if (!autoLock.Succeeded()) {
return nullptr;
}
return mTextureClient->BorrowDrawTarget()->Snapshot();
}
TextureClient*
TextureWrapperImage::GetTextureClient(CompositableClient* aClient)
{
return mTextureClient;
}
} // namespace layers
} // namespace mozilla