EMMA Coverage Report (generated Fri Aug 23 16:39:17 PDT 2013)
[all classes][org.chromium.ui.gfx]

COVERAGE SUMMARY FOR SOURCE FILE [SurfaceTextureListener.java]

nameclass, %method, %block, %line, %
SurfaceTextureListener.java100% (1/1)80%  (4/5)67%  (32/48)77%  (10/13)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class SurfaceTextureListener100% (1/1)80%  (4/5)67%  (32/48)77%  (10/13)
onFrameAvailable (SurfaceTexture): void 0%   (0/1)0%   (0/5)0%   (0/2)
finalize (): void 100% (1/1)62%  (8/13)90%  (3.6/4)
<static initializer> 100% (1/1)75%  (6/8)75%  (0.8/1)
SurfaceTextureListener (int): void 100% (1/1)76%  (13/17)94%  (4.7/5)
create (int): SurfaceTextureListener 100% (1/1)100% (5/5)100% (1/1)

1// Copyright (c) 2013 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4 
5package org.chromium.ui.gfx;
6 
7import android.graphics.SurfaceTexture;
8 
9import org.chromium.base.CalledByNative;
10import org.chromium.base.JNINamespace;
11 
12/**
13 * Listener to an android SurfaceTexture object for frame availability.
14 */
15@JNINamespace("gfx")
16class SurfaceTextureListener implements SurfaceTexture.OnFrameAvailableListener {
17    // Used to determine the class instance to dispatch the native call to.
18    private int mNativeSurfaceTextureListener = 0;
19 
20    private SurfaceTextureListener(int nativeSurfaceTextureListener) {
21        assert nativeSurfaceTextureListener != 0;
22        mNativeSurfaceTextureListener = nativeSurfaceTextureListener;
23    }
24 
25    @Override
26    public void onFrameAvailable(SurfaceTexture surfaceTexture) {
27        nativeFrameAvailable(mNativeSurfaceTextureListener);
28    }
29 
30    @Override
31    protected void finalize() throws Throwable {
32        try {
33            nativeDestroy(mNativeSurfaceTextureListener);
34        } finally {
35            super.finalize();
36        }
37    }
38 
39    @CalledByNative
40    private static SurfaceTextureListener create(int nativeSurfaceTextureListener) {
41        return new SurfaceTextureListener(nativeSurfaceTextureListener);
42    }
43 
44    private native void nativeFrameAvailable(int nativeSurfaceTextureListener);
45    private native void nativeDestroy(int nativeSurfaceTextureListener);
46}

[all classes][org.chromium.ui.gfx]
EMMA 2.0.5312 (C) Vladimir Roubtsov