summaryrefslogtreecommitdiff
path: root/libs/hwui/pipeline/skia/ShaderCache.cpp
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2018-12-13 16:40:14 -0800
committerJohn Reck <jreck@google.com>2018-12-14 14:07:18 -0800
commit283bb46846ad161045efc4650d3cbc40abf5f24b (patch)
tree732e431c7f704282c3ae5a669f22999520f2507e /libs/hwui/pipeline/skia/ShaderCache.cpp
parent832c17330e2d0ce52f1471404ef539a63f120ca2 (diff)
New WebViewFunctor API
Should function alongside existing functor API. Bug: 120997728 Test: hwuiunit passes Change-Id: I8f6143d0be1111431b55016f34de319f6b8c8910
Diffstat (limited to 'libs/hwui/pipeline/skia/ShaderCache.cpp')
-rw-r--r--libs/hwui/pipeline/skia/ShaderCache.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/libs/hwui/pipeline/skia/ShaderCache.cpp b/libs/hwui/pipeline/skia/ShaderCache.cpp
index 073b4814305e..562a3b225e36 100644
--- a/libs/hwui/pipeline/skia/ShaderCache.cpp
+++ b/libs/hwui/pipeline/skia/ShaderCache.cpp
@@ -15,11 +15,11 @@
*/
#include "ShaderCache.h"
-#include <algorithm>
#include <log/log.h>
-#include <thread>
-#include <array>
#include <openssl/sha.h>
+#include <algorithm>
+#include <array>
+#include <thread>
#include "FileBlobCache.h"
#include "Properties.h"
#include "utils/TraceUtils.h"
@@ -44,8 +44,7 @@ ShaderCache& ShaderCache::get() {
}
bool ShaderCache::validateCache(const void* identity, ssize_t size) {
- if (nullptr == identity && size == 0)
- return true;
+ if (nullptr == identity && size == 0) return true;
if (nullptr == identity || size < 0) {
if (CC_UNLIKELY(Properties::debugLevel & kDebugCaches)) {
@@ -66,8 +65,7 @@ bool ShaderCache::validateCache(const void* identity, ssize_t size) {
auto key = sIDKey;
auto loaded = mBlobCache->get(&key, sizeof(key), hash.data(), hash.size());
- if (loaded && std::equal(hash.begin(), hash.end(), mIDHash.begin()))
- return true;
+ if (loaded && std::equal(hash.begin(), hash.end(), mIDHash.begin())) return true;
if (CC_UNLIKELY(Properties::debugLevel & kDebugCaches)) {
ALOGW("ShaderCache::validateCache cache validation fails");
@@ -119,7 +117,7 @@ sk_sp<SkData> ShaderCache::load(const SkData& key) {
int maxTries = 3;
while (valueSize > mObservedBlobValueSize && maxTries > 0) {
mObservedBlobValueSize = std::min(valueSize, maxValueSize);
- void *newValueBuffer = realloc(valueBuffer, mObservedBlobValueSize);
+ void* newValueBuffer = realloc(valueBuffer, mObservedBlobValueSize);
if (!newValueBuffer) {
free(valueBuffer);
return nullptr;
@@ -133,7 +131,7 @@ sk_sp<SkData> ShaderCache::load(const SkData& key) {
return nullptr;
}
if (valueSize > mObservedBlobValueSize) {
- ALOGE("ShaderCache::load value size is too big %d", (int) valueSize);
+ ALOGE("ShaderCache::load value size is too big %d", (int)valueSize);
free(valueBuffer);
return nullptr;
}