Bug 651858 - Part 3: Add layers API for creating an optimal DrawTarget. r=roc

This commit is contained in:
Bas Schouten 2011-06-24 19:41:18 +02:00
parent 208c771f07
commit bc37e50310
2 changed files with 20 additions and 0 deletions

View File

@ -48,6 +48,7 @@
#include "mozilla/Util.h"
using namespace mozilla::layers;
using namespace mozilla::gfx;
typedef FrameMetrics::ViewID ViewID;
const ViewID FrameMetrics::NULL_SCROLL_ID = 0;
@ -210,6 +211,14 @@ LayerManager::CreateOptimalSurface(const gfxIntSize &aSize,
CreateOffscreenSurface(aSize, gfxASurface::ContentFromFormat(aFormat));
}
TemporaryRef<DrawTarget>
LayerManager::CreateDrawTarget(const IntSize &aSize,
SurfaceFormat aFormat)
{
// Right now this doesn't work on the general layer manager.
return NULL;
}
#ifdef DEBUG
void
LayerManager::Mutated(Layer* aLayer)

View File

@ -49,6 +49,8 @@
#include "gfxColor.h"
#include "gfxPattern.h"
#include "mozilla/gfx/2D.h"
#if defined(DEBUG) || defined(PR_LOGGING)
# include <stdio.h> // FILE
# include "prlog.h"
@ -424,6 +426,15 @@ public:
CreateOptimalSurface(const gfxIntSize &aSize,
gfxASurface::gfxImageFormat imageFormat);
/**
* Creates a DrawTarget which is optimized for inter-operating with this
* layermanager.
*/
virtual TemporaryRef<mozilla::gfx::DrawTarget>
CreateDrawTarget(const mozilla::gfx::IntSize &aSize,
mozilla::gfx::SurfaceFormat aFormat);
/**
* Return the name of the layer manager's backend.
*/