Merge branch 'master' into sam460ex

This commit is contained in:
François Revol
2012-12-07 10:59:31 +01:00
11 changed files with 68 additions and 48 deletions
+16 -8
View File
@@ -73,10 +73,14 @@ hgl_viewport(struct gl_context* glContext, GLint x, GLint y,
}
static void
hgl_fill_st_visual(st_visual* stVisual, gl_config* glVisual)
static st_visual*
hgl_fill_st_visual(gl_config* glVisual)
{
memset(stVisual, 0, sizeof(*stVisual));
struct st_visual* stVisual = CALLOC_STRUCT(st_visual);
if (!stVisual) {
ERROR("%s: Couldn't allocate st_visual\n", __func__);
return NULL;
}
// Determine color format
if (glVisual->redBits == 8) {
@@ -129,6 +133,8 @@ hgl_fill_st_visual(st_visual* stVisual, gl_config* glVisual)
if (glVisual->haveDepthBuffer || glVisual->haveStencilBuffer)
stVisual->buffer_mask |= ST_ATTACHMENT_DEPTH_STENCIL_MASK;
return stVisual;
}
@@ -292,11 +298,10 @@ GalliumContext::CreateContext(Bitmap *bitmap)
TRACE("stencilBits :\t%d\n", glVisual->stencilBits);
// Convert Mesa calculated visual into state tracker visual
struct st_visual stVisual;
hgl_fill_st_visual(&stVisual, glVisual);
context->stVisual = hgl_fill_st_visual(glVisual);
context->draw = new GalliumFramebuffer(&stVisual);
context->read = new GalliumFramebuffer(&stVisual);
context->draw = new GalliumFramebuffer(context->stVisual);
context->read = new GalliumFramebuffer(context->stVisual);
if (!context->draw || !context->read) {
ERROR("%s: Problem allocating framebuffer!\n", __func__);
@@ -312,7 +317,7 @@ GalliumContext::CreateContext(Bitmap *bitmap)
memset(&attribs, 0, sizeof(attribs));
attribs.options.force_glsl_extensions_warn = false;
attribs.profile = ST_PROFILE_DEFAULT;
attribs.visual = stVisual;
attribs.visual = *context->stVisual;
attribs.major = 1;
attribs.minor = 0;
//attribs.flags |= ST_CONTEXT_FLAG_DEBUG;
@@ -418,6 +423,9 @@ GalliumContext::DestroyContext(context_id contextID)
if (fContext[contextID]->draw)
delete fContext[contextID]->draw;
if (fContext[contextID]->stVisual)
FREE(fContext[contextID]->stVisual);
if (fContext[contextID]->manager)
FREE(fContext[contextID]->manager);
@@ -32,8 +32,6 @@
DebugReportGenerator::DebugReportGenerator(::Team* team)
:
BLooper("DebugReportGenerator"),
BReferenceable(),
fTeam(team),
fArchitecture(team->GetArchitecture()),
fTeamDataSem(-1)
@@ -7,7 +7,6 @@
#include <Looper.h>
#include <Referenceable.h>
#include "Team.h"
@@ -19,9 +18,7 @@ class Team;
class Thread;
class DebugReportGenerator : public BLooper, public BReferenceable,
public Team::Listener
{
class DebugReportGenerator : public BLooper, public Team::Listener {
public:
DebugReportGenerator(::Team* team);
~DebugReportGenerator();
@@ -284,7 +284,6 @@ TeamDebugger::~TeamDebugger()
delete fMemoryBlockManager;
fReportGenerator->Lock();
fReportGenerator->Quit();
delete fReportGenerator;
delete fWorker;
delete fTeam;
delete fFileManager;
+2 -1
View File
@@ -41,13 +41,14 @@ DwarfManager::LoadFile(const char* fileName, DwarfFile*& _file)
if (file == NULL)
return B_NO_MEMORY;
BReference<DwarfFile> fileReference(file, true);
status_t error = file->Load(fileName);
if (error != B_OK) {
delete file;
return error;
}
fFiles.Add(file);
fileReference.Detach();
// we keep the initial reference for ourselves
file->AcquireReference();
@@ -246,29 +246,28 @@ BListValueNode::ResolvedLocationAndValue(ValueLoader* valueLoader,
if (strcmp(member->Name(), "fObjectList") == 0) {
error = baseType->ResolveDataMemberLocation(member,
*location, memberLocation);
BReference<ValueLocation> locationRef(memberLocation, true);
if (error != B_OK) {
TRACE_LOCALS(
"BListValueNode::ResolvedLocationAndValue(): "
"failed to resolve location of header member: %s\n",
strerror(error));
delete memberLocation;
return error;
}
error = valueLoader->LoadValue(memberLocation, valueType,
false, fDataLocation);
delete memberLocation;
if (error != B_OK)
return error;
} else if (strcmp(member->Name(), "fItemCount") == 0) {
error = baseType->ResolveDataMemberLocation(member,
*location, memberLocation);
BReference<ValueLocation> locationRef(memberLocation, true);
if (error != B_OK) {
TRACE_LOCALS(
"BListValueNode::ResolvedLocationAndValue(): "
"failed to resolve location of header member: %s\n",
strerror(error));
delete memberLocation;
return error;
}
@@ -280,7 +279,6 @@ BListValueNode::ResolvedLocationAndValue(ValueLoader* valueLoader,
BVariant listSize;
error = valueLoader->LoadValue(memberLocation, valueType,
false, listSize);
delete memberLocation;
if (error != B_OK)
return error;
+3 -4
View File
@@ -291,6 +291,7 @@ AppearancePrefView::MessageReceived(BMessage* msg)
_EnableCustomColors(true);
else
_EnableCustomColors(false);
_ChangeColorScheme(newScheme);
modified = true;
}
@@ -393,14 +394,12 @@ AppearancePrefView::_SetCurrentColorScheme(BMenuField* field)
const char* currentSchemeName = NULL;
color_scheme** schemes
= const_cast<color_scheme**>(gPredefinedColorSchemes);
while (*schemes) {
for (const color_scheme** schemes = gPredefinedColorSchemes;
*schemes != NULL; schemes++) {
if (gCustomColorScheme == **schemes) {
currentSchemeName = (*schemes)->name;
break;
}
schemes++;
}
for (int32 i = 0; i < fColorSchemeField->Menu()->CountItems(); i++) {
+12 -15
View File
@@ -14,7 +14,7 @@
// Standard colors
const rgb_color kBlack= { 0, 0, 0, 255 };
const rgb_color kBlack = { 0, 0, 0, 255 };
const rgb_color kGreen = { 0, 255, 0, 255 };
const rgb_color kWhite = { 255, 255, 255, 255 };
const rgb_color kYellow = { 255, 255, 0, 255 };
@@ -35,7 +35,7 @@ const struct color_scheme kColorSchemeBlue = {
kYellow,
{ 0, 0, 139, 255 },
kBlack,
kWhite,
kYellow,
kBlack,
{ 0, 139, 139, 255 },
};
@@ -85,27 +85,24 @@ struct color_scheme gCustomColorScheme = {
};
const color_scheme* gPredefinedColorSchemes[] = {
&kColorSchemeDefault,
&kColorSchemeBlue,
&kColorSchemeMidnight,
&kColorSchemeProfessional,
&kColorSchemeRetro,
&kColorSchemeSlate,
&gCustomColorScheme,
NULL
&kColorSchemeDefault,
&kColorSchemeBlue,
&kColorSchemeMidnight,
&kColorSchemeProfessional,
&kColorSchemeRetro,
&kColorSchemeSlate,
&gCustomColorScheme,
NULL
};
bool
color_scheme::operator==(const color_scheme& scheme)
{
if (text_fore_color == scheme.text_fore_color
return text_fore_color == scheme.text_fore_color
&& text_back_color == scheme.text_back_color
&& cursor_fore_color == scheme.cursor_fore_color
&& cursor_back_color == scheme.cursor_back_color
&& select_fore_color == scheme.select_fore_color
&& select_back_color == scheme.select_back_color)
return true;
return false;
&& select_back_color == scheme.select_back_color;
}
+1 -1
View File
@@ -44,7 +44,7 @@ static const pref_defaults kTermDefaults[] = {
{ PREF_TEXT_FORE_COLOR, " 0, 0, 0" },
{ PREF_TEXT_BACK_COLOR, "255, 255, 255" },
{ PREF_CURSOR_FORE_COLOR, " 0, 0, 0" },
{ PREF_CURSOR_FORE_COLOR, "255, 255, 255" },
{ PREF_CURSOR_BACK_COLOR, " 0, 0, 0" },
{ PREF_SELECT_FORE_COLOR, "255, 255, 255" },
{ PREF_SELECT_BACK_COLOR, " 0, 0, 0" },
+25 -2
View File
@@ -27,8 +27,31 @@ BReferenceable::BReferenceable()
BReferenceable::~BReferenceable()
{
#ifdef DEBUG
if (fReferenceCount > 1)
debugger("Deleted object which still had references.\n");
bool enterDebugger = false;
if (fReferenceCount == 1) {
// Simple heuristic to test if this object was allocated
// on the stack: check if this is within 1KB in either
// direction of the current stack address, and the reference
// count is 1. If so, we don't flag a warning since that would
// imply the object was allocated/destroyed on the stack
// without any references being acquired or released.
char test;
size_t testOffset = (addr_t)this - (addr_t)&test;
if (testOffset > 1024 || -testOffset > 1024) {
// might still be a stack object, check the thread's
// stack range to be sure.
thread_info info;
status_t result = get_thread_info(find_thread(NULL), &info);
if (result != B_OK || this < info.stack_base
|| this > info.stack_end) {
enterDebugger = true;
}
}
} else if (fReferenceCount != 0)
enterDebugger = true;
if (enterDebugger)
debugger("Deleted referenceable object with non-zero ref count.");
#endif
}
+6 -6
View File
@@ -17,16 +17,16 @@
static int
compare_private_data(const void* a, const void* b)
{
return BString::Private::StringFromData((char*)a).Compare(
BString::Private::StringFromData((char*)b));
return BString::Private::StringFromData(*(char**)a).Compare(
BString::Private::StringFromData(*(char**)b));
}
static int
compare_private_data_ignore_case(const void* a, const void* b)
{
return BString::Private::StringFromData((char*)a).ICompare(
BString::Private::StringFromData((char*)b));
return BString::Private::StringFromData(*(char**)a).ICompare(
BString::Private::StringFromData(*(char**)b));
}
@@ -367,7 +367,7 @@ BStringList::Flatten(void* buf, ssize_t size) const
if (size < FlattenedSize())
return B_NO_MEMORY;
int32 count = CountStrings();
for (int32 i = 0; i < count; i++) {
BString item = StringAt(i);
@@ -403,7 +403,7 @@ BStringList::Unflatten(type_code code, const void* buffer, ssize_t size)
}
return B_OK;
}
}
void