mono/MonoGame — pull request #1817 by flibitijibibo (2013-06-23 06:22:14+00:00)
Title: Texture2D: Fix OpenGL GetData with null Rect

In the current Texture2D.GetData, we create a temp array for the texture data even when we do not need to. In the case where we don't need to, the `data` value is reassigned to the temp reference. This isn't entirely efficient, and can cause problems in certain cases (Capsized crashes after attempting to pass the newly obtained Texture2D data to FarseerPhysicsXNA's PolygonCreationAssistance class).

This revision adjusts the GetTexImage call to use `data` directly if `rect` has no value, so we always write our result to the original array.