mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-18 07:45:30 +00:00
Bug 681192. Part 0.3: Add FrameLayerBuilder::GetThebesLayerResolutionForFrame. r=mattwoodrow
--HG-- extra : rebase_source : eea4dee6d081de5c288e295f3549fc88b10e6c39
This commit is contained in:
parent
14f22692ee
commit
5943f7cf5b
@ -2266,6 +2266,46 @@ FrameLayerBuilder::GetDedicatedLayer(nsIFrame* aFrame, PRUint32 aDisplayItemKey)
|
||||
return nsnull;
|
||||
}
|
||||
|
||||
bool
|
||||
FrameLayerBuilder::GetThebesLayerResolutionForFrame(nsIFrame* aFrame,
|
||||
double* aXres, double* aYres,
|
||||
gfxPoint* aPoint)
|
||||
{
|
||||
nsTArray<DisplayItemData> *array = GetDisplayItemDataArrayForFrame(aFrame);
|
||||
if (array) {
|
||||
for (PRUint32 i = 0; i < array->Length(); ++i) {
|
||||
Layer* layer = array->ElementAt(i).mLayer;
|
||||
if (layer->HasUserData(&gThebesDisplayItemLayerUserData)) {
|
||||
ThebesDisplayItemLayerUserData* data =
|
||||
static_cast<ThebesDisplayItemLayerUserData*>
|
||||
(layer->GetUserData(&gThebesDisplayItemLayerUserData));
|
||||
*aXres = data->mXScale;
|
||||
*aYres = data->mYScale;
|
||||
*aPoint = data->mActiveScrolledRootPosition;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
nsIFrame::ChildListIterator lists(aFrame);
|
||||
for (; !lists.IsDone(); lists.Next()) {
|
||||
if (lists.CurrentID() == nsIFrame::kPopupList ||
|
||||
lists.CurrentID() == nsIFrame::kSelectPopupList) {
|
||||
continue;
|
||||
}
|
||||
|
||||
nsFrameList::Enumerator childFrames(lists.CurrentList());
|
||||
for (; !childFrames.AtEnd(); childFrames.Next()) {
|
||||
if (GetThebesLayerResolutionForFrame(childFrames.get(),
|
||||
aXres, aYres, aPoint)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
#ifdef MOZ_DUMP_PAINTING
|
||||
static void DebugPaintItem(nsRenderingContext* aDest, nsDisplayItem *aItem, nsDisplayListBuilder* aBuilder)
|
||||
{
|
||||
|
@ -346,6 +346,17 @@ public:
|
||||
*/
|
||||
nsIntPoint GetLastPaintOffset(ThebesLayer* aLayer);
|
||||
|
||||
/**
|
||||
* Return resolution and scroll offset of ThebesLayer content associated
|
||||
* with aFrame's subtree.
|
||||
* Returns true if some ThebesLayer was found.
|
||||
* This just looks for the first ThebesLayer and returns its data. There
|
||||
* could be other ThebesLayers with different resolution and offsets.
|
||||
*/
|
||||
static bool GetThebesLayerResolutionForFrame(nsIFrame* aFrame,
|
||||
double* aXRes, double* aYRes,
|
||||
gfxPoint* aPoint);
|
||||
|
||||
/**
|
||||
* Clip represents the intersection of an optional rectangle with a
|
||||
* list of rounded rectangles.
|
||||
|
Loading…
Reference in New Issue
Block a user