mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-27 12:50:09 +00:00
Bug 1317430 - Avoid a unnecessary copy by passing a const & in gfx/ r=nical
MozReview-Commit-ID: 4AHG1queVe6 --HG-- extra : rebase_source : cd678e951710321c798b5ca617f39b18f82bea77
This commit is contained in:
parent
34c92c780f
commit
d6ef1e706d
@ -375,7 +375,7 @@ SkImageIsMask(const sk_sp<SkImage>& aImage)
|
||||
}
|
||||
|
||||
static bool
|
||||
ExtractAlphaBitmap(sk_sp<SkImage> aImage, SkBitmap* aResultBitmap)
|
||||
ExtractAlphaBitmap(const sk_sp<SkImage>& aImage, SkBitmap* aResultBitmap)
|
||||
{
|
||||
SkImageInfo info = SkImageInfo::MakeA8(aImage->width(), aImage->height());
|
||||
SkBitmap bitmap;
|
||||
|
@ -59,7 +59,7 @@ SourceSurfaceSkia::InitFromData(unsigned char* aData,
|
||||
}
|
||||
|
||||
bool
|
||||
SourceSurfaceSkia::InitFromImage(sk_sp<SkImage> aImage,
|
||||
SourceSurfaceSkia::InitFromImage(const sk_sp<SkImage>& aImage,
|
||||
SurfaceFormat aFormat,
|
||||
DrawTargetSkia* aOwner)
|
||||
{
|
||||
|
@ -35,7 +35,7 @@ public:
|
||||
int32_t aStride,
|
||||
SurfaceFormat aFormat);
|
||||
|
||||
bool InitFromImage(sk_sp<SkImage> aImage,
|
||||
bool InitFromImage(const sk_sp<SkImage>& aImage,
|
||||
SurfaceFormat aFormat = SurfaceFormat::UNKNOWN,
|
||||
DrawTargetSkia* aOwner = nullptr);
|
||||
|
||||
|
@ -214,7 +214,7 @@ PersistentBufferProviderShared::SetForwarder(ShadowLayerForwarder* aFwd)
|
||||
}
|
||||
|
||||
TextureClient*
|
||||
PersistentBufferProviderShared::GetTexture(Maybe<uint32_t> aIndex)
|
||||
PersistentBufferProviderShared::GetTexture(const Maybe<uint32_t>& aIndex)
|
||||
{
|
||||
if (aIndex.isNothing() || !CheckIndex(aIndex.value())) {
|
||||
return nullptr;
|
||||
|
@ -145,7 +145,7 @@ protected:
|
||||
|
||||
~PersistentBufferProviderShared();
|
||||
|
||||
TextureClient* GetTexture(Maybe<uint32_t> aIndex);
|
||||
TextureClient* GetTexture(const Maybe<uint32_t>& aIndex);
|
||||
bool CheckIndex(uint32_t aIndex) { return aIndex < mTextures.length(); }
|
||||
|
||||
void Destroy();
|
||||
|
Loading…
x
Reference in New Issue
Block a user