From 0957f4acdaa7a74cd93f991390ee9715974469f8 Mon Sep 17 00:00:00 2001 From: Stas Gurtovoy Date: Wed, 3 Aug 2011 09:08:08 +0300 Subject: [PATCH] opengles emulator: fix a bug in RangeList When an intersection is found, we want to add it to the output list, if splitting is needed and if not. Change-Id: I9c9827b1c0ecd434925ff5698dd42bc1025dbedf --- .../libs/Translator/GLcommon/RangeManip.cpp | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/tools/emulator/opengl/host/libs/Translator/GLcommon/RangeManip.cpp b/tools/emulator/opengl/host/libs/Translator/GLcommon/RangeManip.cpp index 96e0970e9..5ba609b08 100644 --- a/tools/emulator/opengl/host/libs/Translator/GLcommon/RangeManip.cpp +++ b/tools/emulator/opengl/host/libs/Translator/GLcommon/RangeManip.cpp @@ -86,17 +86,17 @@ void RangeList::delRange(const Range& r,RangeList& deleted) { erase(i); i--; if (intersection!=old) { // otherwise split: - //intersection on right side - if(old.getStart() != intersection.getStart()) { - list.insert(list.begin(),Range(old.getStart(),intersection.getStart() - old.getStart())); - } - - //intersection on left side - if(old.getEnd() != intersection.getEnd()) { - list.insert(list.begin(),Range(intersection.getEnd(),old.getEnd() - intersection.getEnd())); - } - deleted.addRange(intersection); + //intersection on right side + if(old.getStart() != intersection.getStart()) { + list.insert(list.begin(),Range(old.getStart(),intersection.getStart() - old.getStart())); } + + //intersection on left side + if(old.getEnd() != intersection.getEnd()) { + list.insert(list.begin(),Range(intersection.getEnd(),old.getEnd() - intersection.getEnd())); + } + } + deleted.addRange(intersection); } } }