mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-14 02:31:59 +00:00
aca985efab
This will help make it clearer that this code lives in a different module for contributors. --HG-- rename : layout/base/ActiveLayerTracker.cpp => layout/painting/ActiveLayerTracker.cpp rename : layout/base/ActiveLayerTracker.h => layout/painting/ActiveLayerTracker.h rename : layout/base/BorderCache.h => layout/painting/BorderCache.h rename : layout/base/BorderConsts.h => layout/painting/BorderConsts.h rename : layout/base/DashedCornerFinder.cpp => layout/painting/DashedCornerFinder.cpp rename : layout/base/DashedCornerFinder.h => layout/painting/DashedCornerFinder.h rename : layout/base/DisplayItemClip.cpp => layout/painting/DisplayItemClip.cpp rename : layout/base/DisplayItemClip.h => layout/painting/DisplayItemClip.h rename : layout/base/DisplayItemScrollClip.cpp => layout/painting/DisplayItemScrollClip.cpp rename : layout/base/DisplayItemScrollClip.h => layout/painting/DisplayItemScrollClip.h rename : layout/base/DisplayListClipState.cpp => layout/painting/DisplayListClipState.cpp rename : layout/base/DisplayListClipState.h => layout/painting/DisplayListClipState.h rename : layout/base/DottedCornerFinder.cpp => layout/painting/DottedCornerFinder.cpp rename : layout/base/DottedCornerFinder.h => layout/painting/DottedCornerFinder.h rename : layout/base/FrameLayerBuilder.cpp => layout/painting/FrameLayerBuilder.cpp rename : layout/base/FrameLayerBuilder.h => layout/painting/FrameLayerBuilder.h rename : layout/base/LayerState.h => layout/painting/LayerState.h rename : layout/base/MaskLayerImageCache.cpp => layout/painting/MaskLayerImageCache.cpp rename : layout/base/MaskLayerImageCache.h => layout/painting/MaskLayerImageCache.h rename : layout/base/PaintTracker.cpp => layout/painting/PaintTracker.cpp rename : layout/base/PaintTracker.h => layout/painting/PaintTracker.h rename : layout/base/nsCSSRendering.cpp => layout/painting/nsCSSRendering.cpp rename : layout/base/nsCSSRendering.h => layout/painting/nsCSSRendering.h rename : layout/base/nsCSSRenderingBorders.cpp => layout/painting/nsCSSRenderingBorders.cpp rename : layout/base/nsCSSRenderingBorders.h => layout/painting/nsCSSRenderingBorders.h rename : layout/base/nsDisplayItemTypes.h => layout/painting/nsDisplayItemTypes.h rename : layout/base/nsDisplayItemTypesList.h => layout/painting/nsDisplayItemTypesList.h rename : layout/base/nsDisplayList.cpp => layout/painting/nsDisplayList.cpp rename : layout/base/nsDisplayList.h => layout/painting/nsDisplayList.h rename : layout/base/nsDisplayListInvalidation.cpp => layout/painting/nsDisplayListInvalidation.cpp rename : layout/base/nsDisplayListInvalidation.h => layout/painting/nsDisplayListInvalidation.h
71 lines
1.7 KiB
C++
71 lines
1.7 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 "MaskLayerImageCache.h"
|
|
#include "ImageContainer.h"
|
|
|
|
using namespace mozilla::layers;
|
|
|
|
namespace mozilla {
|
|
|
|
MaskLayerImageCache::MaskLayerImageCache()
|
|
{
|
|
MOZ_COUNT_CTOR(MaskLayerImageCache);
|
|
}
|
|
MaskLayerImageCache::~MaskLayerImageCache()
|
|
{
|
|
MOZ_COUNT_DTOR(MaskLayerImageCache);
|
|
}
|
|
|
|
void
|
|
MaskLayerImageCache::Sweep()
|
|
{
|
|
for (auto iter = mMaskImageContainers.Iter(); !iter.Done(); iter.Next()) {
|
|
const MaskLayerImageCache::MaskLayerImageKey* key = iter.Get()->mKey;
|
|
if (key->HasZeroLayerCount()) {
|
|
iter.Remove();
|
|
}
|
|
}
|
|
}
|
|
|
|
ImageContainer*
|
|
MaskLayerImageCache::FindImageFor(const MaskLayerImageKey** aKey)
|
|
{
|
|
if (MaskLayerImageEntry* entry = mMaskImageContainers.GetEntry(**aKey)) {
|
|
*aKey = entry->mKey.get();
|
|
return entry->mContainer;
|
|
}
|
|
|
|
return nullptr;
|
|
}
|
|
|
|
void
|
|
MaskLayerImageCache::PutImage(const MaskLayerImageKey* aKey, ImageContainer* aContainer)
|
|
{
|
|
MaskLayerImageEntry* entry = mMaskImageContainers.PutEntry(*aKey);
|
|
entry->mContainer = aContainer;
|
|
}
|
|
|
|
MaskLayerImageCache::MaskLayerImageKey::MaskLayerImageKey()
|
|
: mRoundedClipRects()
|
|
, mLayerCount(0)
|
|
{
|
|
MOZ_COUNT_CTOR(MaskLayerImageKey);
|
|
}
|
|
|
|
MaskLayerImageCache::MaskLayerImageKey::MaskLayerImageKey(const MaskLayerImageKey& aKey)
|
|
: mRoundedClipRects(aKey.mRoundedClipRects)
|
|
, mLayerCount(aKey.mLayerCount)
|
|
{
|
|
MOZ_COUNT_CTOR(MaskLayerImageKey);
|
|
}
|
|
|
|
MaskLayerImageCache::MaskLayerImageKey::~MaskLayerImageKey()
|
|
{
|
|
MOZ_COUNT_DTOR(MaskLayerImageKey);
|
|
}
|
|
|
|
} // namespace mozilla
|