Exactly - context and intent are important. It's not just the combination of race and watermelon.
And in the case of the original post, the intent is the problem.
The joke is "funny" because black people like watermelon, so the new black President has replaced Easter eggs with watermelons.
Replace the rows of watermelons with rows of, say, wheat, and it's no longer offensive; it's just bizarre and nonsensical. Watermelons (or, say, fried chicken) make the joke, which pretty much defines it as part of the intent.