blob: 403bdd0a7af20e7661f2aa13224a9c66d3607343 [file] [log] [blame]
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <jni.h>
#include "base/android/jni_weak_ref.h"
#include "base/callback.h"
#include "base/memory/weak_ptr.h"
class SkBitmap;
namespace cc {
class CopyOutputResult;
namespace content {
// Native side of the, which issues content
// readbacks from the Java side.
class ContentReadbackHandler {
// Registers the JNI methods for ContentViewRender.
static bool RegisterContentReadbackHandler(JNIEnv* env);
// Methods called from Java via JNI -----------------------------------------
ContentReadbackHandler(JNIEnv* env, jobject obj);
void Destroy(JNIEnv* env, jobject obj);
void GetContentBitmap(JNIEnv* env,
jobject obj,
jint readback_id,
jfloat scale,
jobject config,
jfloat x,
jfloat y,
jfloat width,
jfloat height,
jobject content_view_core);
void GetCompositorBitmap(JNIEnv* env,
jobject obj,
jint readback_id,
jlong native_window_android);
virtual ~ContentReadbackHandler();
void OnFinishReadback(int readback_id,
bool success,
const SkBitmap& bitmap);
base::android::ScopedJavaGlobalRef<jobject> java_obj_;
base::WeakPtrFactory<ContentReadbackHandler> weak_factory_;
} // namespace content