зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1231888 (follow-up) - Simplify CurrentSurface(). r=jrmuizel.
The previous patch in this bug removed two calls to CurrentSurface(), leaving only one, and that one doesn't need the dx and dy arguments. --HG-- extra : rebase_source : 52cc3d7a1317ea9f239f59c24a58810ce6669c9f
This commit is contained in:
Родитель
f45414c2f0
Коммит
fc9cf6f9d5
|
@ -109,7 +109,7 @@ gfxContext::~gfxContext()
|
|||
}
|
||||
|
||||
already_AddRefed<gfxASurface>
|
||||
gfxContext::CurrentSurface(gfxFloat *dx, gfxFloat *dy)
|
||||
gfxContext::CurrentSurface()
|
||||
{
|
||||
if (mDT->GetBackendType() == BackendType::CAIRO) {
|
||||
cairo_t* ctx = static_cast<cairo_t*>
|
||||
|
@ -117,20 +117,11 @@ gfxContext::CurrentSurface(gfxFloat *dx, gfxFloat *dy)
|
|||
if (ctx) {
|
||||
cairo_surface_t* s = cairo_get_group_target(ctx);
|
||||
if (s) {
|
||||
if (dx && dy) {
|
||||
double sdx, sdy;
|
||||
cairo_surface_get_device_offset(s, &sdx, &sdy);
|
||||
*dx = -CurrentState().deviceOffset.x + sdx;
|
||||
*dy = -CurrentState().deviceOffset.y + sdy;
|
||||
}
|
||||
return gfxASurface::Wrap(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (dx && dy) {
|
||||
*dx = *dy = 0;
|
||||
}
|
||||
// An Azure context doesn't have a surface backing it.
|
||||
return nullptr;
|
||||
}
|
||||
|
|
|
@ -75,15 +75,10 @@ public:
|
|||
static already_AddRefed<gfxContext> ContextForDrawTarget(mozilla::gfx::DrawTarget* aTarget);
|
||||
|
||||
/**
|
||||
* Return the current transparency group target, if any, along
|
||||
* with its device offsets from the top. If no group is
|
||||
* active, returns the surface the gfxContext was created with,
|
||||
* and 0,0 in dx,dy.
|
||||
* Return the current transparency group target, if any. If no group is
|
||||
* active, returns the surface the gfxContext was created with.
|
||||
*/
|
||||
already_AddRefed<gfxASurface> CurrentSurface(gfxFloat *dx, gfxFloat *dy);
|
||||
already_AddRefed<gfxASurface> CurrentSurface() {
|
||||
return CurrentSurface(nullptr, nullptr);
|
||||
}
|
||||
already_AddRefed<gfxASurface> CurrentSurface();
|
||||
|
||||
mozilla::gfx::DrawTarget *GetDrawTarget() { return mDT; }
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче