Skip to content

Commit

Permalink
[Android] Bail out early in onNativeLibraryLoaded with TextureView.
Browse files Browse the repository at this point in the history
We do not need to initialize mSurfaceCallback if we are not using
SurfaceView.

BUG=https://crosswalk-project.org/jira/browse/XWALK-1887

[M49 notes: this commit used to be "[Android] Only initialize
 ContentReadbackHandler in onNativeLibraryLoaded for TextureView", and
 had to be reworked because ContentReadbackHandler was removed in
 http://crrev.com/1415803006 and http://crrev.com/1514403002, so we now
 only need to stop earlier when not using SurfaceView]
  • Loading branch information
Hongbo Min authored and Maksim Sisov committed Aug 16, 2016
1 parent d134925 commit e9c7997
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -172,11 +172,15 @@ public ContentViewRenderView(Context context, CompositingSurfaceType surfaceType
* @param rootWindow The {@link WindowAndroid} this render view should be linked to.
*/
public void onNativeLibraryLoaded(WindowAndroid rootWindow) {
assert !mSurfaceView.getHolder().getSurface().isValid() :
"Surface created before native library loaded.";
assert rootWindow != null;
mNativeContentViewRenderView = nativeInit(rootWindow.getNativePointer());
assert mNativeContentViewRenderView != 0;

if (mCompositingSurfaceType == CompositingSurfaceType.TEXTURE_VIEW)
return;

assert !mSurfaceView.getHolder().getSurface().isValid() :
"Surface created before native library loaded.";
mSurfaceCallback = new SurfaceHolder.Callback() {
@Override
public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
Expand Down

0 comments on commit e9c7997

Please sign in to comment.