Chromium Code Reviews| Index: tools/viewer/sk_app/android/surface_glue_android.cpp |
| diff --git a/tools/viewer/sk_app/android/surface_glue_android.cpp b/tools/viewer/sk_app/android/surface_glue_android.cpp |
| index 3a4fca539c8204489e381c4b6cba7c0fc0c261c6..e374473105a5d0451ec86b32d65dab99a1b206b6 100644 |
| --- a/tools/viewer/sk_app/android/surface_glue_android.cpp |
| +++ b/tools/viewer/sk_app/android/surface_glue_android.cpp |
| @@ -70,12 +70,6 @@ void SkiaAndroidApp::setTitle(const char* title) const { |
| fPThreadEnv->DeleteLocalRef(titleString); |
| } |
| -void SkiaAndroidApp::paintIfNeeded() { |
| - if (fNativeWindow && fWindow) { |
| - fWindow->onPaint(); |
| - } |
| -} |
| - |
| void SkiaAndroidApp::postMessage(const Message& message) const { |
| SkDEBUGCODE(auto writeSize =) write(fPipes[1], &message, sizeof(message)); |
| SkASSERT(writeSize == sizeof(message)); |
| @@ -86,14 +80,6 @@ void SkiaAndroidApp::readMessage(Message* message) const { |
| SkASSERT(readSize == sizeof(Message)); |
| } |
| -void SkiaAndroidApp::inval() { |
| - SkAutoMutexAcquire ama(fMutex); |
| - if (!fIsContentInvalidated) { |
| - postMessage(Message(kContentInvalidated)); |
| - fIsContentInvalidated = true; |
| - } |
| -} |
| - |
| int SkiaAndroidApp::message_callback(int fd, int events, void* data) { |
| auto skiaAndroidApp = (SkiaAndroidApp*)data; |
| Message message; |
| @@ -108,9 +94,7 @@ int SkiaAndroidApp::message_callback(int fd, int events, void* data) { |
| return 0; |
| } |
| case kContentInvalidated: { |
| - SkAutoMutexAcquire ama(skiaAndroidApp->fMutex); |
| - skiaAndroidApp->fIsContentInvalidated = false; |
| - skiaAndroidApp->paintIfNeeded(); |
| + ((Window_android*)skiaAndroidApp->fWindow)->paintIfNeeded(); |
| break; |
| } |
| case kSurfaceCreated: { |
| @@ -118,7 +102,7 @@ int SkiaAndroidApp::message_callback(int fd, int events, void* data) { |
| skiaAndroidApp->fNativeWindow = message.fNativeWindow; |
| auto window_android = (Window_android*)skiaAndroidApp->fWindow; |
| window_android->initDisplay(skiaAndroidApp->fNativeWindow); |
| - skiaAndroidApp->paintIfNeeded(); |
| + ((Window_android*)skiaAndroidApp->fWindow)->paintIfNeeded(); |
|
djsollen
2016/05/23 16:48:51
simplify to window_android->paintIfNeeded();
liyuqian
2016/05/23 17:00:38
Done.
|
| break; |
| } |
| case kSurfaceChanged: { |
| @@ -128,7 +112,7 @@ int SkiaAndroidApp::message_callback(int fd, int events, void* data) { |
| int height = ANativeWindow_getHeight(skiaAndroidApp->fNativeWindow); |
| auto window_android = (Window_android*)skiaAndroidApp->fWindow; |
| window_android->setContentRect(0, 0, width, height); |
| - skiaAndroidApp->paintIfNeeded(); |
| + ((Window_android*)skiaAndroidApp->fWindow)->paintIfNeeded(); |
| break; |
| } |
| case kSurfaceDestroyed: { |