Lock the external buffer when dirty.

Optimize blitting by avoiding locking the internal buffer
when the external one is dirty.

Bug 21424351

Change-Id: Ib798418d0fa93ae5049102ca767dadc2806cd224
Reviewed-on: https://swiftshader-review.googlesource.com/3439
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
2 files changed