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

Side by Side Diff: sky/shell/platform_view.cc

Issue 974483004: Stocks app shouldn't show black when resuming from recents list (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 9 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 unified diff | Download patch
« no previous file with comments | « sky/shell/platform_view.h ('k') | sky/shell/shell.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "sky/shell/platform_view.h" 5 #include "sky/shell/platform_view.h"
6 6
7 #include <android/input.h> 7 #include <android/input.h>
8 #include <android/native_window_jni.h> 8 #include <android/native_window_jni.h>
9 9
10 #include "base/android/jni_android.h" 10 #include "base/android/jni_android.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 52
53 void PlatformView::SurfaceCreated(JNIEnv* env, jobject obj, jobject jsurface) { 53 void PlatformView::SurfaceCreated(JNIEnv* env, jobject obj, jobject jsurface) {
54 base::android::ScopedJavaLocalRef<jobject> protector(env, jsurface); 54 base::android::ScopedJavaLocalRef<jobject> protector(env, jsurface);
55 // Note: This ensures that any local references used by 55 // Note: This ensures that any local references used by
56 // ANativeWindow_fromSurface are released immediately. This is needed as a 56 // ANativeWindow_fromSurface are released immediately. This is needed as a
57 // workaround for https://code.google.com/p/android/issues/detail?id=68174 57 // workaround for https://code.google.com/p/android/issues/detail?id=68174
58 { 58 {
59 base::android::ScopedJavaLocalFrame scoped_local_reference_frame(env); 59 base::android::ScopedJavaLocalFrame scoped_local_reference_frame(env);
60 window_ = ANativeWindow_fromSurface(env, jsurface); 60 window_ = ANativeWindow_fromSurface(env, jsurface);
61 } 61 }
62 config_.gpu_task_runner->PostTask( 62 config_.ui_task_runner->PostTask(
63 FROM_HERE, base::Bind(&GPUDelegate::OnAcceleratedWidgetAvailable, 63 FROM_HERE, base::Bind(&UIDelegate::OnAcceleratedWidgetAvailable,
64 config_.gpu_delegate, window_)); 64 config_.ui_delegate, window_));
65 } 65 }
66 66
67 void PlatformView::SurfaceDestroyed(JNIEnv* env, jobject obj) { 67 void PlatformView::SurfaceDestroyed(JNIEnv* env, jobject obj) {
68 DCHECK(window_); 68 DCHECK(window_);
69 config_.gpu_task_runner->PostTask( 69 config_.ui_task_runner->PostTask(
70 FROM_HERE, 70 FROM_HERE,
71 base::Bind(&GPUDelegate::OnOutputSurfaceDestroyed, config_.gpu_delegate)); 71 base::Bind(&UIDelegate::OnOutputSurfaceDestroyed, config_.ui_delegate));
72 ReleaseWindow(); 72 ReleaseWindow();
73 } 73 }
74 74
75 void PlatformView::ReleaseWindow() { 75 void PlatformView::ReleaseWindow() {
76 ANativeWindow_release(window_); 76 ANativeWindow_release(window_);
77 window_ = nullptr; 77 window_ = nullptr;
78 } 78 }
79 79
80 } // namespace shell 80 } // namespace shell
81 } // namespace sky 81 } // namespace sky
OLDNEW
« no previous file with comments | « sky/shell/platform_view.h ('k') | sky/shell/shell.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698