Hash :
77a72f6e
Author :
Date :
2015-04-14T11:18:32
Release Surface when calling makeCurrent with null. Refactorings to egl::Surface to enable ref-counting were causing a situation where we could have two Window surfaces alive at the same time. This would confuse the window procedure logic in SurfaceD3D. Releasing the surface fixes this issue and conforms closely to the wording on the spec on when Surfaces should be deleted. Also add a test for message loops and surfaces. BUG=475085 BUG=angleproject:963 Change-Id: Icdee3a7db97c9b54d779dabf1e1f82a89fefc546 Reviewed-on: https://chromium-review.googlesource.com/265064 Reviewed-by: Kenneth Russell <kbr@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
//
// Copyright (c) 2014 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
#include "OSWindow.h"
OSWindow::OSWindow()
: mWidth(0),
mHeight(0)
{
}
OSWindow::~OSWindow()
{}
int OSWindow::getWidth() const
{
return mWidth;
}
int OSWindow::getHeight() const
{
return mHeight;
}
bool OSWindow::popEvent(Event *event)
{
if (mEvents.size() > 0 && event)
{
*event = mEvents.front();
mEvents.pop_front();
return true;
}
else
{
return false;
}
}
void OSWindow::pushEvent(Event event)
{
switch (event.Type)
{
case Event::EVENT_RESIZED:
mWidth = event.Size.Width;
mHeight = event.Size.Height;
break;
}
mEvents.push_back(event);
}
bool OSWindow::didTestEventFire()
{
Event topEvent;
while (popEvent(&topEvent))
{
if (topEvent.Type == Event::EVENT_TEST)
{
return true;
}
}
return false;
}