widget/gonk/Framebuffer.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
michael@0 2 /* vim: set sw=2 ts=8 et ft=cpp : */
michael@0 3 /* Copyright 2012 Mozilla Foundation and Mozilla contributors
michael@0 4 *
michael@0 5 * Licensed under the Apache License, Version 2.0 (the "License");
michael@0 6 * you may not use this file except in compliance with the License.
michael@0 7 * You may obtain a copy of the License at
michael@0 8 *
michael@0 9 * http://www.apache.org/licenses/LICENSE-2.0
michael@0 10 *
michael@0 11 * Unless required by applicable law or agreed to in writing, software
michael@0 12 * distributed under the License is distributed on an "AS IS" BASIS,
michael@0 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
michael@0 14 * See the License for the specific language governing permissions and
michael@0 15 * limitations under the License.
michael@0 16 */
michael@0 17
michael@0 18 class gfxASurface;
michael@0 19 class nsIntRegion;
michael@0 20 class nsIntSize;
michael@0 21
michael@0 22 namespace mozilla {
michael@0 23
michael@0 24 namespace Framebuffer {
michael@0 25
michael@0 26 //
michael@0 27 // The general usage of Framebuffer is
michael@0 28 //
michael@0 29 // -- in initialization code --
michael@0 30 // Open();
michael@0 31 //
michael@0 32 // -- ready to paint next frame --
michael@0 33 // nsRefPtr<gfxASurface> backBuffer = BackBuffer();
michael@0 34 // // ...
michael@0 35 // Paint(backBuffer);
michael@0 36 // // ...
michael@0 37 // Present();
michael@0 38 //
michael@0 39
michael@0 40 // Return true if the fbdev was successfully opened. If this fails,
michael@0 41 // the result of all further calls is undefined. Open() is idempotent.
michael@0 42 bool Open();
michael@0 43
michael@0 44 // After Close(), the result of all further calls is undefined.
michael@0 45 // Close() is idempotent, and Open() can be called again after
michael@0 46 // Close().
michael@0 47 void Close();
michael@0 48
michael@0 49 // Return true if the fbdev was successfully opened or the size was
michael@0 50 // already cached.
michael@0 51 bool GetSize(nsIntSize *aScreenSize);
michael@0 52
michael@0 53 // Return the buffer to be drawn into, that will be the next frame.
michael@0 54 gfxASurface* BackBuffer();
michael@0 55
michael@0 56 // Swap the front buffer for the back buffer. |aUpdated| is the
michael@0 57 // region of the back buffer that was repainted.
michael@0 58 void Present(const nsIntRegion& aUpdated);
michael@0 59
michael@0 60 } // namespace Framebuffer
michael@0 61
michael@0 62 } // namespace mozilla

mercurial