Make BView::PopState() (executed at least on every call to Draw()) a lot

cheaper by preventing to rebuild the clipping on the app_server side.
I think this was commented out, because user clipping was broken until
some point and I forgot to reenable it after I fixed it. At least I cannot
spot any regressions when running with this patch now would I expect to
see regressions, since DrawStates do not mess with the screen clipping,
unless they get a clipping region assigned when the (user) clipping changes
during the state's life time.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29773 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus 2009-03-29 10:51:26 +00:00
parent dec2485ca0
commit 2e44cfce66
3 changed files with 11 additions and 3 deletions

View File

@ -135,7 +135,7 @@ DrawState::ReadFontFromLink(BPrivate::LinkReceiver& link)
link.Read<float>(&size);
fFont.SetSize(size);
}
if (mask & B_FONT_SHEAR) {
float shear;
link.Read<float>(&shear);
@ -246,7 +246,7 @@ DrawState::WriteToLink(BPrivate::LinkSender& link) const
link.Attach<uint8>(fFont.Encoding());
link.Attach<uint16>(fFont.Face());
link.Attach<uint32>(fFont.Flags());
// Attach view state
link.Attach<BPoint>(fPenLocation);
link.Attach<float>(fPenSize);
@ -341,6 +341,13 @@ DrawState::HasClipping() const
}
bool
DrawState::HasAdditionalClipping() const
{
return fClippingRegion != NULL;
}
bool
DrawState::GetCombinedClippingRegion(BRegion* region) const
{

View File

@ -65,6 +65,7 @@ public:
void SetClippingRegion(const BRegion* region);
bool HasClipping() const;
bool HasAdditionalClipping() const;
bool GetCombinedClippingRegion(BRegion* region) const;
// coordinate transformations

View File

@ -1260,7 +1260,7 @@ View::PopState()
return;
}
bool rebuildClipping = true; //fDrawState->ClippingRegion() != NULL;
bool rebuildClipping = fDrawState->HasAdditionalClipping();
fDrawState = fDrawState->PopState();
fDrawState->SetSubPixelPrecise(fFlags & B_SUBPIXEL_PRECISE);