2011-12-24 07:13:33 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: sw=2 ts=8 et ft=cpp : */
|
2012-05-21 11:12:37 +00:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2011-12-24 07:13:33 +00:00
|
|
|
|
|
|
|
class gfxASurface;
|
2011-12-31 02:28:40 +00:00
|
|
|
class nsIntRegion;
|
2011-12-24 07:13:33 +00:00
|
|
|
class nsIntSize;
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
|
|
|
|
namespace Framebuffer {
|
|
|
|
|
|
|
|
//
|
|
|
|
// The general usage of Framebuffer is
|
|
|
|
//
|
|
|
|
// -- in initialization code --
|
|
|
|
// Open();
|
|
|
|
//
|
|
|
|
// -- ready to paint next frame --
|
|
|
|
// nsRefPtr<gfxASurface> backBuffer = BackBuffer();
|
|
|
|
// // ...
|
|
|
|
// Paint(backBuffer);
|
|
|
|
// // ...
|
|
|
|
// Present();
|
|
|
|
//
|
|
|
|
|
2012-06-26 14:38:50 +00:00
|
|
|
// Return true if the fbdev was successfully opened. If this fails,
|
|
|
|
// the result of all further calls is undefined. Open() is idempotent.
|
|
|
|
bool Open();
|
2011-12-24 07:13:33 +00:00
|
|
|
|
|
|
|
// After Close(), the result of all further calls is undefined.
|
|
|
|
// Close() is idempotent, and Open() can be called again after
|
|
|
|
// Close().
|
|
|
|
void Close();
|
|
|
|
|
2012-06-26 14:38:50 +00:00
|
|
|
// Return true if the fbdev was successfully opened or the size was
|
|
|
|
// already cached.
|
2012-04-05 16:15:19 +00:00
|
|
|
bool GetSize(nsIntSize *aScreenSize);
|
|
|
|
|
2011-12-24 07:13:33 +00:00
|
|
|
// Return the buffer to be drawn into, that will be the next frame.
|
|
|
|
gfxASurface* BackBuffer();
|
|
|
|
|
2011-12-31 02:28:40 +00:00
|
|
|
// Swap the front buffer for the back buffer. |aUpdated| is the
|
|
|
|
// region of the back buffer that was repainted.
|
|
|
|
void Present(const nsIntRegion& aUpdated);
|
2011-12-24 07:13:33 +00:00
|
|
|
|
|
|
|
} // namespace Framebuffer
|
|
|
|
|
|
|
|
} // namespace mozilla
|