diff options
| author | 2017-10-15 06:16:22 +0000 | |
|---|---|---|
| committer | 2017-10-15 06:16:22 +0000 | |
| commit | a039340cacb0621c9bae44d5efd52aa50e71becc (patch) | |
| tree | befb75711996d0f72845f2b85c2ce3b68b7991c6 | |
| parent | ab5e67a5528555da0f9c3bde8b8bbd2bc38838d2 (diff) | |
| parent | 6d560a52fceb9a8efc20f9a8b80e72558a1b2d3f (diff) | |
Merge "Use -Werror in frameworks/native/libs/gui and ui" am: c4ebf5bbab am: 3a566dd1e1 am: 14ac77cd1e
am: 6d560a52fc
Change-Id: I6b612a1fff0da31b16c1121d0f3d08abf407336c
| -rw-r--r-- | include/private/ui/RegionHelper.h | 1 | ||||
| -rw-r--r-- | libs/gui/Android.bp | 5 | ||||
| -rw-r--r-- | libs/gui/Surface.cpp | 5 | ||||
| -rw-r--r-- | libs/gui/tests/Android.bp | 4 | ||||
| -rw-r--r-- | libs/gui/tests/CpuConsumer_test.cpp | 6 | ||||
| -rw-r--r-- | libs/gui/tests/SurfaceTextureGL_test.cpp | 1 | ||||
| -rw-r--r-- | libs/gui/tests/Surface_test.cpp | 4 | ||||
| -rw-r--r-- | libs/ui/Android.bp | 5 | ||||
| -rw-r--r-- | libs/ui/GraphicBufferMapper.cpp | 23 | ||||
| -rw-r--r-- | libs/ui/tests/Android.bp | 2 |
10 files changed, 18 insertions, 38 deletions
diff --git a/include/private/ui/RegionHelper.h b/include/private/ui/RegionHelper.h index 380e7454ad..0ec3e9474e 100644 --- a/include/private/ui/RegionHelper.h +++ b/include/private/ui/RegionHelper.h @@ -81,7 +81,6 @@ public: int inside = spanner.next(current.top, current.bottom); spannerInner.prepare(inside); do { - TYPE left, right; int inner_inside = spannerInner.next(current.left, current.right); if ((op_mask >> inner_inside) & 1) { if (current.left < current.right && diff --git a/libs/gui/Android.bp b/libs/gui/Android.bp index 21debc1a83..cf72d55894 100644 --- a/libs/gui/Android.bp +++ b/libs/gui/Android.bp @@ -25,9 +25,12 @@ cc_library_shared { }, clang: true, + cflags: [ + "-Wall", + "-Werror", + ], cppflags: [ "-Weverything", - "-Werror", // The static constructors and destructors in this library have not been noted to // introduce significant overheads diff --git a/libs/gui/Surface.cpp b/libs/gui/Surface.cpp index 6c9d88b599..e9393831c7 100644 --- a/libs/gui/Surface.cpp +++ b/libs/gui/Surface.cpp @@ -153,7 +153,10 @@ status_t Surface::getDisplayRefreshCycleDuration(nsecs_t* outRefreshDuration) { ATRACE_CALL(); DisplayStatInfo stats; - status_t err = composerService()->getDisplayStats(NULL, &stats); + status_t result = composerService()->getDisplayStats(NULL, &stats); + if (result != NO_ERROR) { + return result; + } *outRefreshDuration = stats.vsyncPeriod; diff --git a/libs/gui/tests/Android.bp b/libs/gui/tests/Android.bp index fa87f29aa1..908959ce1a 100644 --- a/libs/gui/tests/Android.bp +++ b/libs/gui/tests/Android.bp @@ -7,6 +7,10 @@ cc_test { test_suites: ["device-tests"], clang: true, + cflags: [ + "-Wall", + "-Werror", + ], srcs: [ "BufferItemConsumer_test.cpp", diff --git a/libs/gui/tests/CpuConsumer_test.cpp b/libs/gui/tests/CpuConsumer_test.cpp index 0982d7e9f4..588e54142f 100644 --- a/libs/gui/tests/CpuConsumer_test.cpp +++ b/libs/gui/tests/CpuConsumer_test.cpp @@ -310,8 +310,6 @@ void checkGreyscaleBuffer(const CpuConsumer::LockedBuffer &buf) { uint32_t h = buf.height; const int blockWidth = w > 16 ? w / 16 : 1; const int blockHeight = h > 16 ? h / 16 : 1; - const int blockRows = h / blockHeight; - const int blockCols = w / blockWidth; // Top-left square is bright checkPixel(buf, 0, 0, 191); @@ -349,8 +347,6 @@ void checkRgba8888Buffer(const CpuConsumer::LockedBuffer &buf) { uint32_t h = buf.height; const int blockWidth = w > 16 ? w / 16 : 1; const int blockHeight = h > 16 ? h / 16 : 1; - const int blockRows = h / blockHeight; - const int blockCols = w / blockWidth; // Top-left square is bright red checkPixel(buf, 0, 0, 191, 63, 63); @@ -392,8 +388,6 @@ void checkBayerRawBuffer(const CpuConsumer::LockedBuffer &buf) { uint32_t h = buf.height; const int blockWidth = (w > 16 ? w / 8 : 2) & ~0x1; const int blockHeight = (h > 16 ? h / 8 : 2) & ~0x1; - const int blockRows = h / blockHeight; - const int blockCols = w / blockWidth; // Top-left square is red checkPixel(buf, 0, 0, 1000, 200, 200); diff --git a/libs/gui/tests/SurfaceTextureGL_test.cpp b/libs/gui/tests/SurfaceTextureGL_test.cpp index c6745d034d..56392867ea 100644 --- a/libs/gui/tests/SurfaceTextureGL_test.cpp +++ b/libs/gui/tests/SurfaceTextureGL_test.cpp @@ -323,7 +323,6 @@ TEST_F(SurfaceTextureGLTest, TexturingFromCpuFilledYV12BuffersRepeatedly) { for (int j = 0; j < numTestPixels; j++) { int x = testPixels[j].x; int y = testPixels[j].y; - uint8_t value = 0; if (j == (i % numTestPixels)) { // We must y-invert the texture coords EXPECT_TRUE(checkPixel(x, texHeight-y-1, 255, 255, 255, 255)); diff --git a/libs/gui/tests/Surface_test.cpp b/libs/gui/tests/Surface_test.cpp index bfcd75f26c..572760e77d 100644 --- a/libs/gui/tests/Surface_test.cpp +++ b/libs/gui/tests/Surface_test.cpp @@ -1080,7 +1080,6 @@ TEST_F(GetFrameTimestampsTest, CompositorTimingUpdatesBasic) { EXPECT_EQ(initialCompositorTiming.presentLatency, compositeToPresentLatency); - const uint64_t fId1 = getNextFrameId(); dequeueAndQueue(0); addFrameEvents(true, NO_FRAME_INDEX, 0); @@ -1094,7 +1093,6 @@ TEST_F(GetFrameTimestampsTest, CompositorTimingUpdatesBasic) { EXPECT_EQ(initialCompositorTiming.presentLatency, compositeToPresentLatency); - const uint64_t fId2 = getNextFrameId(); dequeueAndQueue(1); addFrameEvents(true, 0, 1); @@ -1167,7 +1165,6 @@ TEST_F(GetFrameTimestampsTest, CompositorTimingDeadlineSnaps) { nsecs_t expectedDeadline = initialCompositorTiming.deadline; EXPECT_EQ(expectedDeadline, compositeDeadline); - const uint64_t fId1 = getNextFrameId(); dequeueAndQueue(0); addFrameEvents(true, NO_FRAME_INDEX, 0); @@ -1180,7 +1177,6 @@ TEST_F(GetFrameTimestampsTest, CompositorTimingDeadlineSnaps) { initialCompositorTiming.deadline +initialCompositorTiming.interval; EXPECT_EQ(expectedDeadline, compositeDeadline); - const uint64_t fId2 = getNextFrameId(); dequeueAndQueue(1); addFrameEvents(true, 0, 1); diff --git a/libs/ui/Android.bp b/libs/ui/Android.bp index a2664f18de..a610a516ac 100644 --- a/libs/ui/Android.bp +++ b/libs/ui/Android.bp @@ -20,9 +20,12 @@ cc_library_shared { }, clang: true, + cflags: [ + "-Wall", + "-Werror", + ], cppflags: [ "-Weverything", - "-Werror", // The static constructors and destructors in this library have not been noted to // introduce significant overheads diff --git a/libs/ui/GraphicBufferMapper.cpp b/libs/ui/GraphicBufferMapper.cpp index 672dc361a1..2cac2874a8 100644 --- a/libs/ui/GraphicBufferMapper.cpp +++ b/libs/ui/GraphicBufferMapper.cpp @@ -154,29 +154,6 @@ status_t GraphicBufferMapper::lockAsync(buffer_handle_t handle, return static_cast<status_t>(error); } -static inline bool isValidYCbCrPlane(const android_flex_plane_t& plane) { - if (plane.bits_per_component != 8) { - ALOGV("Invalid number of bits per component: %d", - plane.bits_per_component); - return false; - } - if (plane.bits_used != 8) { - ALOGV("Invalid number of bits used: %d", plane.bits_used); - return false; - } - - bool hasValidIncrement = plane.h_increment == 1 || - (plane.component != FLEX_COMPONENT_Y && plane.h_increment == 2); - hasValidIncrement = hasValidIncrement && plane.v_increment > 0; - if (!hasValidIncrement) { - ALOGV("Invalid increment: h %d v %d", plane.h_increment, - plane.v_increment); - return false; - } - - return true; -} - status_t GraphicBufferMapper::lockAsyncYCbCr(buffer_handle_t handle, uint32_t usage, const Rect& bounds, android_ycbcr *ycbcr, int fenceFd) { diff --git a/libs/ui/tests/Android.bp b/libs/ui/tests/Android.bp index 6733505090..08067fcf5d 100644 --- a/libs/ui/tests/Android.bp +++ b/libs/ui/tests/Android.bp @@ -18,10 +18,12 @@ cc_test { name: "Region_test", shared_libs: ["libui"], srcs: ["Region_test.cpp"], + cflags: ["-Wall", "-Werror"], } cc_test { name: "colorspace_test", shared_libs: ["libui"], srcs: ["colorspace_test.cpp"], + cflags: ["-Wall", "-Werror"], } |