mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-10 19:00:13 +01:00
Remove intelUpdateFramebufferSize(), use st_resize_framebuffer().
This commit is contained in:
parent
3d14b2c01e
commit
e9d2156edf
3 changed files with 16 additions and 38 deletions
|
|
@ -169,7 +169,6 @@ intelDestroyContext(__DRIcontextPrivate * driContextPriv)
|
|||
{
|
||||
struct intel_context *intel =
|
||||
(struct intel_context *) driContextPriv->driverPrivate;
|
||||
GLcontext *ctx = intel->st->ctx;
|
||||
|
||||
assert(intel); /* should never be null */
|
||||
if (intel) {
|
||||
|
|
@ -203,55 +202,36 @@ intelUnbindContext(__DRIcontextPrivate * driContextPriv)
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Copied/modified from drirenderbuffer.c
|
||||
*/
|
||||
void
|
||||
intelUpdateFramebufferSize(GLcontext *ctx, const __DRIdrawablePrivate *dPriv)
|
||||
{
|
||||
struct gl_framebuffer *fb = (struct gl_framebuffer *) dPriv->driverPrivate;
|
||||
if (fb && (dPriv->w != fb->Width || dPriv->h != fb->Height)) {
|
||||
_mesa_resize_framebuffer(ctx, fb, dPriv->w, dPriv->h);
|
||||
/* if the driver needs the hw lock for ResizeBuffers, the drawable
|
||||
might have changed again by now */
|
||||
assert(fb->Width == dPriv->w);
|
||||
assert(fb->Height == dPriv->h);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
GLboolean
|
||||
intelMakeCurrent(__DRIcontextPrivate * driContextPriv,
|
||||
__DRIdrawablePrivate * driDrawPriv,
|
||||
__DRIdrawablePrivate * driReadPriv)
|
||||
{
|
||||
if (driContextPriv) {
|
||||
struct intel_context *intel =
|
||||
(struct intel_context *) driContextPriv->driverPrivate;
|
||||
struct intel_context *intel
|
||||
= (struct intel_context *) driContextPriv->driverPrivate;
|
||||
struct st_framebuffer *draw_fb
|
||||
= (struct st_framebuffer *) driDrawPriv->driverPrivate;
|
||||
struct st_framebuffer *read_fb
|
||||
= (struct st_framebuffer *) driReadPriv->driverPrivate;
|
||||
GLcontext *ctx = intel->st->ctx;
|
||||
|
||||
/* this is a hack so we have a valid context when the region allocation
|
||||
is done. Need a per-screen context? */
|
||||
intel->intelScreen->dummyctxptr = intel;
|
||||
|
||||
/* update GLframebuffer size to match window if needed */
|
||||
intelUpdateFramebufferSize(ctx, driDrawPriv);
|
||||
|
||||
if (driReadPriv != driDrawPriv) {
|
||||
intelUpdateFramebufferSize(ctx, driReadPriv);
|
||||
}
|
||||
|
||||
st_make_current(intel->st, draw_fb, read_fb);
|
||||
|
||||
/* update size of Mesa framebuffer(s) to match window */
|
||||
st_resize_framebuffer(draw_fb, driDrawPriv->w, driDrawPriv->h);
|
||||
if (driReadPriv != driDrawPriv) {
|
||||
st_resize_framebuffer(read_fb, driReadPriv->w, driReadPriv->h);
|
||||
}
|
||||
|
||||
if ((intel->driDrawable != driDrawPriv) ||
|
||||
(intel->lastStamp != driDrawPriv->lastStamp)) {
|
||||
intel->driDrawable = driDrawPriv;
|
||||
intelWindowMoved(intel);
|
||||
intel->lastStamp = driDrawPriv->lastStamp;
|
||||
intel->driDrawable = driDrawPriv;
|
||||
intelWindowMoved(intel);
|
||||
intel->lastStamp = driDrawPriv->lastStamp;
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
|
|
|||
|
|
@ -140,7 +140,4 @@ intel_context(GLcontext * ctx)
|
|||
}
|
||||
|
||||
|
||||
extern void
|
||||
intelUpdateFramebufferSize(GLcontext *ctx, const __DRIdrawablePrivate *dPriv);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@
|
|||
#include "context.h"
|
||||
|
||||
#include "pipe/p_context.h"
|
||||
#include "state_tracker/st_public.h"
|
||||
#include "state_tracker/st_context.h"
|
||||
#include "state_tracker/st_cb_fbo.h"
|
||||
|
||||
|
|
@ -237,17 +238,17 @@ intelDisplaySurface(__DRIdrawablePrivate * dPriv,
|
|||
|
||||
/**
|
||||
* This will be called whenever the currently bound window is moved/resized.
|
||||
* XXX: actually, it seems to NOT be called when the window is only moved (BP).
|
||||
*/
|
||||
void
|
||||
intelWindowMoved(struct intel_context *intel)
|
||||
{
|
||||
GLcontext *ctx = intel->st->ctx;
|
||||
__DRIdrawablePrivate *dPriv = intel->driDrawable;
|
||||
struct intel_framebuffer *intel_fb = dPriv->driverPrivate;
|
||||
struct st_framebuffer *stfb
|
||||
= (struct st_framebuffer *) dPriv->driverPrivate;
|
||||
|
||||
st_resize_framebuffer(stfb, dPriv->w, dPriv->h);
|
||||
|
||||
/* Update Mesa's notion of window size */
|
||||
intelUpdateFramebufferSize(ctx, dPriv);
|
||||
intel_fb->Base.Initialized = GL_TRUE; /* XXX remove someday */
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue