Merge "Fix google-build-using-namespace warnings."
am: 78dd9f4c77

Change-Id: I0351ca7b847b7b4ea45ed818ff6a059c7d007741
diff --git a/cpp/Allocation.cpp b/cpp/Allocation.cpp
index 3f29073..75a8806 100644
--- a/cpp/Allocation.cpp
+++ b/cpp/Allocation.cpp
@@ -17,9 +17,9 @@
 #include "RenderScript.h"
 #include "rsCppInternal.h"
 
-using namespace android;
-using namespace RSC;
-
+using android::RSC::Allocation;
+using android::RSC::sp;
+using android::Surface;
 
 void * Allocation::getIDSafe() const {
     return getID();
@@ -496,7 +496,7 @@
 #if !defined(RS_SERVER) && !defined(RS_COMPATIBILITY_LIB)
 #include <gui/Surface.h>
 
-RSC::sp<Surface> Allocation::getSurface() {
+sp<Surface> Allocation::getSurface() {
     if ((mUsage & RS_ALLOCATION_USAGE_IO_INPUT) == 0) {
         mRS->throwError(RS_ERROR_INVALID_PARAMETER, "Can only get Surface if IO_INPUT usage specified.");
         return nullptr;
@@ -509,7 +509,7 @@
     return new Surface(bp, true);;
 }
 
-void Allocation::setSurface(const RSC::sp<Surface>& s) {
+void Allocation::setSurface(const sp<Surface>& s) {
     if ((mUsage & RS_ALLOCATION_USAGE_IO_OUTPUT) == 0) {
         mRS->throwError(RS_ERROR_INVALID_PARAMETER, "Can only set Surface if IO_OUTPUT usage specified.");
         return;
diff --git a/cpp/BaseObj.cpp b/cpp/BaseObj.cpp
index 59eaa9a..973e15f 100644
--- a/cpp/BaseObj.cpp
+++ b/cpp/BaseObj.cpp
@@ -17,8 +17,7 @@
 #include "RenderScript.h"
 #include "rsCppInternal.h"
 
-using namespace android;
-using namespace RSC;
+using android::RSC::BaseObj;
 
 void * BaseObj::getID() const {
     if (mID == nullptr) {
diff --git a/cpp/Element.cpp b/cpp/Element.cpp
index 9b4617a..767284e 100644
--- a/cpp/Element.cpp
+++ b/cpp/Element.cpp
@@ -20,8 +20,7 @@
 #include "RenderScript.h"
 #include "rsCppInternal.h"
 
-using namespace android;
-using namespace RSC;
+using android::RSC::Element;
 
 android::RSC::sp<const Element> Element::getSubElement(uint32_t index) {
     if (!mVisibleElementMapSize) {
diff --git a/cpp/RenderScript.cpp b/cpp/RenderScript.cpp
index f7e9a67..ae1a69a 100644
--- a/cpp/RenderScript.cpp
+++ b/cpp/RenderScript.cpp
@@ -31,9 +31,8 @@
 #include "rsCompatibilityLib.h"
 #endif
 
-
-using namespace android;
-using namespace RSC;
+using android::RSC::RS;
+using android::RSC::RSError;
 
 bool RS::gInitialized = false;
 bool RS::usingNative = false;
diff --git a/cpp/Sampler.cpp b/cpp/Sampler.cpp
index 5aebd86..1079e1c 100644
--- a/cpp/Sampler.cpp
+++ b/cpp/Sampler.cpp
@@ -17,8 +17,8 @@
 #include "RenderScript.h"
 #include "rsCppInternal.h"
 
-using namespace android;
-using namespace RSC;
+using android::RSC::Sampler;
+using android::RSC::sp;
 
 Sampler::Sampler(sp<RS> rs, void* id):
     BaseObj(id, rs)
diff --git a/cpp/Script.cpp b/cpp/Script.cpp
index d0a7d43..ab8aa95 100644
--- a/cpp/Script.cpp
+++ b/cpp/Script.cpp
@@ -19,8 +19,7 @@
 #include "RenderScript.h"
 #include "rsCppInternal.h"
 
-using namespace android;
-using namespace RSC;
+using android::RSC::Script;
 
 void Script::invoke(uint32_t slot, const void *v, size_t len) const {
     tryDispatch(mRS, RS::dispatch->ScriptInvokeV(mRS->getContext(), getID(), slot, v, len));
diff --git a/cpp/ScriptC.cpp b/cpp/ScriptC.cpp
index 57d9019..18c18dd 100644
--- a/cpp/ScriptC.cpp
+++ b/cpp/ScriptC.cpp
@@ -17,8 +17,7 @@
 #include "RenderScript.h"
 #include "rsCppInternal.h"
 
-using namespace android;
-using namespace RSC;
+using android::RSC::ScriptC;
 
 ScriptC::ScriptC(sp<RS> rs,
                  const void *codeTxt, size_t codeLength,
diff --git a/cpp/ScriptIntrinsicBLAS.cpp b/cpp/ScriptIntrinsicBLAS.cpp
index dd31f81..2e31de8 100644
--- a/cpp/ScriptIntrinsicBLAS.cpp
+++ b/cpp/ScriptIntrinsicBLAS.cpp
@@ -20,8 +20,14 @@
 
 #define NELEM(m) (sizeof(m) / sizeof((m)[0]))
 
-using namespace android;
-using namespace RSC;
+using android::RSC::Allocation;
+using android::RSC::Element;
+using android::RSC::RS;
+using android::RSC::RS_ERROR_INVALID_ELEMENT;
+using android::RSC::RS_ERROR_INVALID_PARAMETER;
+using android::RSC::RS_SUCCESS;
+using android::RSC::ScriptIntrinsicBLAS;
+using android::RSC::sp;
 
 // ScriptIntrinsicBLAS APIS
 ScriptIntrinsicBLAS::ScriptIntrinsicBLAS(sp<RS> rs, sp<const Element> e)
diff --git a/cpp/ScriptIntrinsics.cpp b/cpp/ScriptIntrinsics.cpp
index b1a6dcf..da587c4 100644
--- a/cpp/ScriptIntrinsics.cpp
+++ b/cpp/ScriptIntrinsics.cpp
@@ -19,8 +19,18 @@
 #include "RenderScript.h"
 #include "rsCppInternal.h"
 
-using namespace android;
-using namespace RSC;
+using android::RSC::ScriptIntrinsic;
+using android::RSC::ScriptIntrinsic3DLUT;
+using android::RSC::ScriptIntrinsicBlend;
+using android::RSC::ScriptIntrinsicBlur;
+using android::RSC::ScriptIntrinsicColorMatrix;
+using android::RSC::ScriptIntrinsicConvolve3x3;
+using android::RSC::ScriptIntrinsicConvolve5x5;
+using android::RSC::ScriptIntrinsicHistogram;
+using android::RSC::ScriptIntrinsicLUT;
+using android::RSC::ScriptIntrinsicResize;
+using android::RSC::ScriptIntrinsicYuvToRGB;
+using android::RSC::sp;
 
 ScriptIntrinsic::ScriptIntrinsic(sp<RS> rs, int id, sp<const Element> e)
     : Script(nullptr, rs) {
@@ -633,4 +643,4 @@
     }
 
     Script::forEach(0, nullptr, out, nullptr, 0);
-}
\ No newline at end of file
+}
diff --git a/cpp/Type.cpp b/cpp/Type.cpp
index 70bbe4c..cfe1b7e 100644
--- a/cpp/Type.cpp
+++ b/cpp/Type.cpp
@@ -26,8 +26,10 @@
     HAL_PIXEL_FORMAT_YCrCb_420_SP       = 0x11,       // NV21
 };
 
-using namespace android;
-using namespace RSC;
+using android::RSC::Element;
+using android::RSC::RS;
+using android::RSC::Type;
+using android::RSC::sp;
 
 void Type::calcElementCount() {
     bool hasLod = hasMipmaps();