michael@0: /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* vim: set sw=2 ts=8 et ft=cpp : */ michael@0: /* Copyright 2012 Mozilla Foundation and Mozilla contributors michael@0: * michael@0: * Licensed under the Apache License, Version 2.0 (the "License"); michael@0: * you may not use this file except in compliance with the License. michael@0: * You may obtain a copy of the License at michael@0: * michael@0: * http://www.apache.org/licenses/LICENSE-2.0 michael@0: * michael@0: * Unless required by applicable law or agreed to in writing, software michael@0: * distributed under the License is distributed on an "AS IS" BASIS, michael@0: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. michael@0: * See the License for the specific language governing permissions and michael@0: * limitations under the License. michael@0: */ michael@0: michael@0: class gfxASurface; michael@0: class nsIntRegion; michael@0: class nsIntSize; michael@0: michael@0: namespace mozilla { michael@0: michael@0: namespace Framebuffer { michael@0: michael@0: // michael@0: // The general usage of Framebuffer is michael@0: // michael@0: // -- in initialization code -- michael@0: // Open(); michael@0: // michael@0: // -- ready to paint next frame -- michael@0: // nsRefPtr backBuffer = BackBuffer(); michael@0: // // ... michael@0: // Paint(backBuffer); michael@0: // // ... michael@0: // Present(); michael@0: // michael@0: michael@0: // Return true if the fbdev was successfully opened. If this fails, michael@0: // the result of all further calls is undefined. Open() is idempotent. michael@0: bool Open(); michael@0: michael@0: // After Close(), the result of all further calls is undefined. michael@0: // Close() is idempotent, and Open() can be called again after michael@0: // Close(). michael@0: void Close(); michael@0: michael@0: // Return true if the fbdev was successfully opened or the size was michael@0: // already cached. michael@0: bool GetSize(nsIntSize *aScreenSize); michael@0: michael@0: // Return the buffer to be drawn into, that will be the next frame. michael@0: gfxASurface* BackBuffer(); michael@0: michael@0: // Swap the front buffer for the back buffer. |aUpdated| is the michael@0: // region of the back buffer that was repainted. michael@0: void Present(const nsIntRegion& aUpdated); michael@0: michael@0: } // namespace Framebuffer michael@0: michael@0: } // namespace mozilla