Merge "Fix DrawFilter's usage in HWUI."
This commit is contained in:
committed by
Android (Google) Code Review
commit
240d52cb96
@@ -101,6 +101,16 @@ public:
|
||||
}
|
||||
|
||||
static jlong init(JNIEnv* env, jobject clazz) {
|
||||
SK_COMPILE_ASSERT(1 << 0 == SkPaint::kAntiAlias_Flag, paint_flags_mismatch);
|
||||
SK_COMPILE_ASSERT(1 << 2 == SkPaint::kDither_Flag, paint_flags_mismatch);
|
||||
SK_COMPILE_ASSERT(1 << 3 == SkPaint::kUnderlineText_Flag, paint_flags_mismatch);
|
||||
SK_COMPILE_ASSERT(1 << 4 == SkPaint::kStrikeThruText_Flag, paint_flags_mismatch);
|
||||
SK_COMPILE_ASSERT(1 << 5 == SkPaint::kFakeBoldText_Flag, paint_flags_mismatch);
|
||||
SK_COMPILE_ASSERT(1 << 6 == SkPaint::kLinearText_Flag, paint_flags_mismatch);
|
||||
SK_COMPILE_ASSERT(1 << 7 == SkPaint::kSubpixelText_Flag, paint_flags_mismatch);
|
||||
SK_COMPILE_ASSERT(1 << 8 == SkPaint::kDevKernText_Flag, paint_flags_mismatch);
|
||||
SK_COMPILE_ASSERT(1 << 10 == SkPaint::kEmbeddedBitmapText_Flag, paint_flags_mismatch);
|
||||
|
||||
Paint* obj = new Paint();
|
||||
defaultSettingsForAndroid(obj);
|
||||
return reinterpret_cast<jlong>(obj);
|
||||
|
||||
@@ -484,7 +484,7 @@ void DisplayListRenderer::drawRects(const float* rects, int count, const SkPaint
|
||||
}
|
||||
|
||||
void DisplayListRenderer::setDrawFilter(SkDrawFilter* filter) {
|
||||
mDrawFilter.reset(filter);
|
||||
mDrawFilter.reset(SkSafeRef(filter));
|
||||
}
|
||||
|
||||
void DisplayListRenderer::insertReorderBarrier(bool enableReorder) {
|
||||
|
||||
@@ -296,8 +296,9 @@ private:
|
||||
// so that we don't need to modify the paint every time we access it.
|
||||
SkTLazy<SkPaint> filteredPaint;
|
||||
if (mDrawFilter.get()) {
|
||||
paint = filteredPaint.init();
|
||||
filteredPaint.set(*paint);
|
||||
mDrawFilter->filter(filteredPaint.get(), SkDrawFilter::kPaint_Type);
|
||||
paint = filteredPaint.get();
|
||||
}
|
||||
|
||||
// compute the hash key for the paint and check the cache.
|
||||
|
||||
Reference in New Issue
Block a user