system/core Replace cutils/log.h with android/log.h

Should use android/log.h instead of cutils/log.h as a good example
to all others.  Adjust header order to comply with Android Coding
standards.

Test: Compile
Bug: 26552300
Bug: 31289077
Change-Id: I2c9cbbbd64d8dccf2d44356361d9742e4a9b9031
diff --git a/libpixelflinger/codeflinger/ARMAssembler.cpp b/libpixelflinger/codeflinger/ARMAssembler.cpp
index 849512a..36c1326 100644
--- a/libpixelflinger/codeflinger/ARMAssembler.cpp
+++ b/libpixelflinger/codeflinger/ARMAssembler.cpp
@@ -2,16 +2,16 @@
 **
 ** Copyright 2006, The Android Open Source Project
 **
-** Licensed under the Apache License, Version 2.0 (the "License"); 
-** you may not use this file except in compliance with the License. 
-** You may obtain a copy of the License at 
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
 **
-**     http://www.apache.org/licenses/LICENSE-2.0 
+**     http://www.apache.org/licenses/LICENSE-2.0
 **
-** Unless required by applicable law or agreed to in writing, software 
-** distributed under the License is distributed on an "AS IS" BASIS, 
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
-** See the License for the specific language governing permissions and 
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
 ** limitations under the License.
 */
 
@@ -19,9 +19,9 @@
 
 #include <stdio.h>
 #include <stdlib.h>
-#include <cutils/log.h>
-#include <cutils/properties.h>
 
+#include <android/log.h>
+#include <cutils/properties.h>
 #include <private/pixelflinger/ggl_context.h>
 
 #include "ARMAssembler.h"
diff --git a/libpixelflinger/codeflinger/ARMAssemblerInterface.cpp b/libpixelflinger/codeflinger/ARMAssemblerInterface.cpp
index 5041999..67eba80 100644
--- a/libpixelflinger/codeflinger/ARMAssemblerInterface.cpp
+++ b/libpixelflinger/codeflinger/ARMAssemblerInterface.cpp
@@ -2,26 +2,26 @@
 **
 ** Copyright 2006, The Android Open Source Project
 **
-** Licensed under the Apache License, Version 2.0 (the "License"); 
-** you may not use this file except in compliance with the License. 
-** You may obtain a copy of the License at 
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
 **
-**     http://www.apache.org/licenses/LICENSE-2.0 
+**     http://www.apache.org/licenses/LICENSE-2.0
 **
-** Unless required by applicable law or agreed to in writing, software 
-** distributed under the License is distributed on an "AS IS" BASIS, 
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
-** See the License for the specific language governing permissions and 
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
 ** limitations under the License.
 */
 
-
 #include <errno.h>
-#include <stdlib.h>
 #include <stdint.h>
+#include <stdlib.h>
 #include <sys/types.h>
 
-#include <cutils/log.h>
+#include <android/log.h>
+
 #include "ARMAssemblerInterface.h"
 
 namespace android {
diff --git a/libpixelflinger/codeflinger/Arm64Assembler.cpp b/libpixelflinger/codeflinger/Arm64Assembler.cpp
index bd11818..fb297ec 100644
--- a/libpixelflinger/codeflinger/Arm64Assembler.cpp
+++ b/libpixelflinger/codeflinger/Arm64Assembler.cpp
@@ -32,14 +32,13 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include <cutils/log.h>
+#include <android/log.h>
 #include <cutils/properties.h>
 #include <private/pixelflinger/ggl_context.h>
 
 #include "codeflinger/Arm64Assembler.h"
-#include "codeflinger/CodeCache.h"
 #include "codeflinger/Arm64Disassembler.h"
-
+#include "codeflinger/CodeCache.h"
 
 /*
 ** --------------------------------------------
diff --git a/libpixelflinger/codeflinger/CodeCache.cpp b/libpixelflinger/codeflinger/CodeCache.cpp
index ae38519..37bd074 100644
--- a/libpixelflinger/codeflinger/CodeCache.cpp
+++ b/libpixelflinger/codeflinger/CodeCache.cpp
@@ -15,17 +15,16 @@
 ** limitations under the License.
 */
 
+#define LOG_TAG "CodeCache"
 
 #include <assert.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include <unistd.h>
 #include <sys/mman.h>
+#include <unistd.h>
 
+#include <android/log.h>
 #include <cutils/ashmem.h>
-#define LOG_TAG "CodeCache"
-#include <cutils/log.h>
-
 
 #include "CodeCache.h"
 
diff --git a/libpixelflinger/codeflinger/GGLAssembler.cpp b/libpixelflinger/codeflinger/GGLAssembler.cpp
index 346779f..0b9b5a4 100644
--- a/libpixelflinger/codeflinger/GGLAssembler.cpp
+++ b/libpixelflinger/codeflinger/GGLAssembler.cpp
@@ -2,16 +2,16 @@
 **
 ** Copyright 2006, The Android Open Source Project
 **
-** Licensed under the Apache License, Version 2.0 (the "License"); 
-** you may not use this file except in compliance with the License. 
-** You may obtain a copy of the License at 
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
 **
-**     http://www.apache.org/licenses/LICENSE-2.0 
+**     http://www.apache.org/licenses/LICENSE-2.0
 **
-** Unless required by applicable law or agreed to in writing, software 
-** distributed under the License is distributed on an "AS IS" BASIS, 
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
-** See the License for the specific language governing permissions and 
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
 ** limitations under the License.
 */
 
@@ -19,10 +19,11 @@
 
 #include <assert.h>
 #include <stdint.h>
-#include <stdlib.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <sys/types.h>
-#include <cutils/log.h>
+
+#include <android/log.h>
 
 #include "GGLAssembler.h"
 
diff --git a/libpixelflinger/codeflinger/MIPS64Assembler.cpp b/libpixelflinger/codeflinger/MIPS64Assembler.cpp
index b9f31ff..a7bbaf7 100644
--- a/libpixelflinger/codeflinger/MIPS64Assembler.cpp
+++ b/libpixelflinger/codeflinger/MIPS64Assembler.cpp
@@ -25,24 +25,21 @@
 **
 */
 
-
 #define LOG_TAG "MIPS64Assembler"
 
 #include <stdio.h>
 #include <stdlib.h>
-#include <cutils/log.h>
-#include <cutils/properties.h>
 
+#include <android/log.h>
+#include <cutils/properties.h>
 #include <private/pixelflinger/ggl_context.h>
 
 #include "MIPS64Assembler.h"
 #include "CodeCache.h"
 #include "mips64_disassem.h"
 
-
 #define NOT_IMPLEMENTED()  LOG_ALWAYS_FATAL("Arm instruction %s not yet implemented\n", __func__)
 
-
 // ----------------------------------------------------------------------------
 
 namespace android {
diff --git a/libpixelflinger/codeflinger/MIPSAssembler.cpp b/libpixelflinger/codeflinger/MIPSAssembler.cpp
index ae06a13..4cddcc8 100644
--- a/libpixelflinger/codeflinger/MIPSAssembler.cpp
+++ b/libpixelflinger/codeflinger/MIPSAssembler.cpp
@@ -52,13 +52,13 @@
 
 #include <stdio.h>
 #include <stdlib.h>
-#include <cutils/log.h>
-#include <cutils/properties.h>
 
+#include <android/log.h>
+#include <cutils/properties.h>
 #include <private/pixelflinger/ggl_context.h>
 
-#include "MIPSAssembler.h"
 #include "CodeCache.h"
+#include "MIPSAssembler.h"
 #include "mips_disassem.h"
 
 // Choose MIPS arch variant following gcc flags
diff --git a/libpixelflinger/codeflinger/blending.cpp b/libpixelflinger/codeflinger/blending.cpp
index b20219c..d4aa475 100644
--- a/libpixelflinger/codeflinger/blending.cpp
+++ b/libpixelflinger/codeflinger/blending.cpp
@@ -2,30 +2,29 @@
 **
 ** Copyright 2006, The Android Open Source Project
 **
-** Licensed under the Apache License, Version 2.0 (the "License"); 
-** you may not use this file except in compliance with the License. 
-** You may obtain a copy of the License at 
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
 **
-**     http://www.apache.org/licenses/LICENSE-2.0 
+**     http://www.apache.org/licenses/LICENSE-2.0
 **
-** Unless required by applicable law or agreed to in writing, software 
-** distributed under the License is distributed on an "AS IS" BASIS, 
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
-** See the License for the specific language governing permissions and 
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
 ** limitations under the License.
 */
 
 #include <assert.h>
 #include <stdint.h>
-#include <stdlib.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <sys/types.h>
 
-#include <cutils/log.h>
+#include <android/log.h>
 
 #include "GGLAssembler.h"
 
-
 namespace android {
 
 void GGLAssembler::build_fog(
diff --git a/libpixelflinger/codeflinger/load_store.cpp b/libpixelflinger/codeflinger/load_store.cpp
index e5a1ae0..d68f6dc 100644
--- a/libpixelflinger/codeflinger/load_store.cpp
+++ b/libpixelflinger/codeflinger/load_store.cpp
@@ -2,22 +2,24 @@
 **
 ** Copyright 2006, The Android Open Source Project
 **
-** Licensed under the Apache License, Version 2.0 (the "License"); 
-** you may not use this file except in compliance with the License. 
-** You may obtain a copy of the License at 
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
 **
-**     http://www.apache.org/licenses/LICENSE-2.0 
+**     http://www.apache.org/licenses/LICENSE-2.0
 **
-** Unless required by applicable law or agreed to in writing, software 
-** distributed under the License is distributed on an "AS IS" BASIS, 
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
-** See the License for the specific language governing permissions and 
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
 ** limitations under the License.
 */
 
 #include <assert.h>
 #include <stdio.h>
-#include <cutils/log.h>
+
+#include <android/log.h>
+
 #include "GGLAssembler.h"
 
 namespace android {
@@ -25,7 +27,7 @@
 // ----------------------------------------------------------------------------
 
 void GGLAssembler::store(const pointer_t& addr, const pixel_t& s, uint32_t flags)
-{    
+{
     const int bits = addr.size;
     const int inc = (flags & WRITE_BACK)?1:0;
     switch (bits) {
@@ -59,8 +61,8 @@
 }
 
 void GGLAssembler::load(const pointer_t& addr, const pixel_t& s, uint32_t flags)
-{    
-    Scratch scratches(registerFile());    
+{
+    Scratch scratches(registerFile());
     int s0;
 
     const int bits = addr.size;
@@ -72,7 +74,7 @@
         break;
     case 24:
         // 24 bits formats are a little special and used only for RGB
-        // R,G,B is packed as 0x00BBGGRR 
+        // R,G,B is packed as 0x00BBGGRR
         s0 = scratches.obtain();
         if (s.reg != addr.reg) {
             LDRB(AL, s.reg, addr.reg, immed12_pre(0));      // R
@@ -90,7 +92,7 @@
         }
         if (inc)
             ADD(AL, 0, addr.reg, addr.reg, imm(3));
-        break;        
+        break;
     case 16:
         if (inc)    LDRH(AL, s.reg, addr.reg, immed8_post(2));
         else        LDRH(AL, s.reg, addr.reg);
@@ -112,7 +114,7 @@
     assert(maskLen<=8);
 #endif
     assert(h);
-    
+
     if (h != bits) {
         const int mask = ((1<<maskLen)-1) << l;
         if (isValidImmediate(mask)) {
@@ -126,12 +128,12 @@
         }
         s = d.reg;
     }
-    
+
     if (l) {
         MOV(AL, 0, d.reg, reg_imm(s, LSR, l));  // component = packed >> l;
         s = d.reg;
     }
-    
+
     if (s != d.reg) {
         MOV(AL, 0, d.reg, s);
     }
@@ -212,12 +214,12 @@
         } while(dbits>0);
         return;
     }
-    
+
     dbits -= sbits;
     do {
         ORR(AL, 0, d, s, reg_imm(s, LSL, sbits));
             // d |= d<<sbits;
-        s = d;        
+        s = d;
         dbits -= sbits;
         if (sbits*2 < dbits) {
             sbits *= 2;
@@ -241,14 +243,14 @@
     int dl = d.format.c[component].l;
     int dbits = dh - dl;
     int dithering = 0;
-    
+
     ALOGE_IF(sbits<dbits, "sbits (%d) < dbits (%d) in downshift", sbits, dbits);
 
     if (sbits>dbits) {
         // see if we need to dither
         dithering = mDithering;
     }
-    
+
     int ireg = d.reg;
     if (!(d.flags & FIRST)) {
         if (s.flags & CORRUPTIBLE)  {
@@ -271,7 +273,7 @@
                 if (isValidImmediate(mask) || isValidImmediate(~mask)) {
                     build_and_immediate(ireg, s.reg, mask, 32);
                     sl = offset;
-                    s.reg = ireg; 
+                    s.reg = ireg;
                     sbits = dbits;
                     maskLoBits = maskHiBits = 0;
                 }
@@ -281,7 +283,7 @@
             const uint32_t mask = ((1<<sbits)-1) << sl;
             if (isValidImmediate(mask) || isValidImmediate(~mask)) {
                 build_and_immediate(ireg, s.reg, mask, 32);
-                s.reg = ireg; 
+                s.reg = ireg;
                 maskLoBits = maskHiBits = 0;
             }
         }
@@ -325,7 +327,7 @@
             MOV(AL, 0, ireg, reg_imm(s.reg, LSR, sl));
             sh -= sl;
             sl = 0;
-            s.reg = ireg; 
+            s.reg = ireg;
         }
         // scaling (V-V>>dbits)
         SUB(AL, 0, ireg, s.reg, reg_imm(s.reg, LSR, dbits));
@@ -333,7 +335,7 @@
         if (shift>0)        ADD(AL, 0, ireg, ireg, reg_imm(dither.reg, LSR, shift));
         else if (shift<0)   ADD(AL, 0, ireg, ireg, reg_imm(dither.reg, LSL,-shift));
         else                ADD(AL, 0, ireg, ireg, dither.reg);
-        s.reg = ireg; 
+        s.reg = ireg;
     }
 
     if ((maskLoBits|dithering) && (sh > dbits)) {
diff --git a/libpixelflinger/codeflinger/mips64_disassem.c b/libpixelflinger/codeflinger/mips64_disassem.c
index 44b7fe7..f28d726 100644
--- a/libpixelflinger/codeflinger/mips64_disassem.c
+++ b/libpixelflinger/codeflinger/mips64_disassem.c
@@ -34,21 +34,20 @@
  *  from: @(#)kadb.c    8.1 (Berkeley) 6/10/93
  */
 
-#include <stdio.h>
-#include <stdint.h>
 #include <stdarg.h>
 #include <stdbool.h>
+#include <stdint.h>
+#include <stdio.h>
 #include <sys/cdefs.h>
-
 #include <sys/types.h>
-#include "mips_opcode.h"
 
-#include <cutils/log.h>
+#include <android/log.h>
+
+#include "mips_opcode.h"
 
 static char *sprintf_buffer;
 static int sprintf_buf_len;
 
-
 typedef uint64_t db_addr_t;
 static void db_printf(const char* fmt, ...);
 
diff --git a/libpixelflinger/codeflinger/texturing.cpp b/libpixelflinger/codeflinger/texturing.cpp
index 29a3742..d66981d 100644
--- a/libpixelflinger/codeflinger/texturing.cpp
+++ b/libpixelflinger/codeflinger/texturing.cpp
@@ -2,26 +2,26 @@
 **
 ** Copyright 2006, The Android Open Source Project
 **
-** Licensed under the Apache License, Version 2.0 (the "License"); 
-** you may not use this file except in compliance with the License. 
-** You may obtain a copy of the License at 
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
 **
-**     http://www.apache.org/licenses/LICENSE-2.0 
+**     http://www.apache.org/licenses/LICENSE-2.0
 **
-** Unless required by applicable law or agreed to in writing, software 
-** distributed under the License is distributed on an "AS IS" BASIS, 
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
-** See the License for the specific language governing permissions and 
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
 ** limitations under the License.
 */
 
 #include <assert.h>
 #include <stdint.h>
-#include <stdlib.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <sys/types.h>
 
-#include <cutils/log.h>
+#include <android/log.h>
 
 #include "GGLAssembler.h"