Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(126)

Unified Diff: tools/viewer/sk_app/android/surface_glue_android.cpp

Issue 2001153002: Move inval dedup to Window for wider usages. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Improve Comments Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/viewer/sk_app/android/surface_glue_android.h ('k') | tools/viewer/sk_app/win/Window_win.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..958b7876b8baa674aec32cc89c684d8f7db0edda 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();
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->paintIfNeeded();
break;
}
case kSurfaceDestroyed: {
« no previous file with comments | « tools/viewer/sk_app/android/surface_glue_android.h ('k') | tools/viewer/sk_app/win/Window_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698