2011-12-24 11:13:33 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-06-29 14:42:59 +04:00
|
|
|
/* vim: set sw=2 ts=8 et ft=cpp : */
|
2012-07-20 13:10:44 +04:00
|
|
|
/* Copyright 2012 Mozilla Foundation and Mozilla contributors
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
2011-12-24 11:13:33 +04:00
|
|
|
|
|
|
|
class gfxASurface;
|
2011-12-31 06:28:40 +04:00
|
|
|
class nsIntRegion;
|
2011-12-24 11:13:33 +04: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 18:38:50 +04: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 11:13:33 +04: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 18:38:50 +04:00
|
|
|
// Return true if the fbdev was successfully opened or the size was
|
|
|
|
// already cached.
|
2012-04-05 20:15:19 +04:00
|
|
|
bool GetSize(nsIntSize *aScreenSize);
|
|
|
|
|
2011-12-24 11:13:33 +04:00
|
|
|
// Return the buffer to be drawn into, that will be the next frame.
|
|
|
|
gfxASurface* BackBuffer();
|
|
|
|
|
2011-12-31 06:28:40 +04: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 11:13:33 +04:00
|
|
|
|
|
|
|
} // namespace Framebuffer
|
|
|
|
|
|
|
|
} // namespace mozilla
|