Axis::Overscroll Axis::GetOverscroll() { // If the current pan takes the window to the left of or above the current // page rect. bool minus = GetOrigin() < GetPageStart(); // If the current pan takes the window to the right of or below the current // page rect. bool plus = GetCompositionEnd() > GetPageEnd(); if (minus && plus) { return OVERSCROLL_BOTH; } if (minus) { return OVERSCROLL_MINUS; } if (plus) { return OVERSCROLL_PLUS; } return OVERSCROLL_NONE; }
Axis::Overscroll Axis::DisplacementWillOverscroll(float aDisplacement) { // If the current pan plus a displacement takes the window to the left of or // above the current page rect. bool minus = GetOrigin() + aDisplacement < GetPageStart(); // If the current pan plus a displacement takes the window to the right of or // below the current page rect. bool plus = GetCompositionEnd() + aDisplacement > GetPageEnd(); if (minus && plus) { return OVERSCROLL_BOTH; } if (minus) { return OVERSCROLL_MINUS; } if (plus) { return OVERSCROLL_PLUS; } return OVERSCROLL_NONE; }
Axis::Overscroll Axis::ScaleWillOverscroll(float aScale, int32_t aFocus) { float originAfterScale = (GetOrigin() + aFocus) * aScale - aFocus; bool both = ScaleWillOverscrollBothSides(aScale); bool minus = originAfterScale < GetPageStart() * aScale; bool plus = (originAfterScale + GetCompositionLength()) > GetPageEnd() * aScale; if ((minus && plus) || both) { return OVERSCROLL_BOTH; } if (minus) { return OVERSCROLL_MINUS; } if (plus) { return OVERSCROLL_PLUS; } return OVERSCROLL_NONE; }
int FrameBuffer::HandleAccess(char* pBase, char* pAddr, DWORD dwReadWrite) { DWORD dwOldAccess; char* pPage = GetPageStart(pAddr); if (dwReadWrite == 0) { CopyInBitmapData(); } else { if (!IsBufferUpToDate()) CopyInBitmapData(); VirtualProtect(pPage, m_iPageSize, PAGE_READWRITE, &dwOldAccess); m_setModifiedPages.insert(pPage); } return EXCEPTION_CONTINUE_EXECUTION; }
float Axis::GetPageEnd() { return GetPageStart() + GetPageLength(); }
bool Axis::HasRoomToPan() const { return GetOrigin() > GetPageStart() || GetCompositionEnd() < GetPageEnd(); }
CSSCoord Axis::GetPageEnd() const { return GetPageStart() + GetPageLength(); }
ParentLayerCoord Axis::GetPageEnd() const { return GetPageStart() + GetPageLength(); }