OSDN Git Service

Move a shared pointer that's going to die anyway.
authorGeorge Burgess IV <gbiv@google.com>
Thu, 18 Jan 2018 19:30:46 +0000 (11:30 -0800)
committerGeorge Burgess IV <gbiv@google.com>
Thu, 18 Jan 2018 19:33:07 +0000 (11:33 -0800)
This saves us two atomic operations that a copy would cost us (inc +
dec), and hopefully makes some internal tooling -- which yet doesn't
model atomics well -- happy.

Bug: None
Test: Builds
Change-Id: Ic55c3db6af55f45eceaf30c1ee479e9ae70aabb4

core/jni/android/graphics/ImageDecoder.cpp

index ed9d0e9..1c2528f 100644 (file)
@@ -393,7 +393,7 @@ static jobject ImageDecoder_nDecodeBitmap(JNIEnv* env, jobject /*clazz*/, jlong
         canvas.drawBitmap(bm, 0.0f, 0.0f, &paint);
 
         bm.swap(scaledBm);
-        nativeBitmap = scaledPixelRef;
+        nativeBitmap = std::move(scaledPixelRef);
     }
 
     if (jpostProcess) {