blob: f1fc6a4918a148d81a5e3f3406017aec06aadcb1 [file] [log] [blame]
// Copyright 2016 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_android.h"
#include "base/macros.h"
#include "ui/display/screen_base.h"
#include "ui/gfx/geometry/size.h"
namespace ui {
class WindowAndroid;
class DisplayAndroidManager : public display::ScreenBase {
~DisplayAndroidManager() override;
// Screen interface.
display::Display GetDisplayNearestWindow(
gfx::NativeWindow window) const override;
display::Display GetDisplayNearestView(gfx::NativeView view) const override;
display::Display GetDisplayNearestPoint(
const gfx::Point& point) const override;
display::Display GetDisplayMatching(
const gfx::Rect& match_rect) const override;
// Methods called from Java.
void UpdateDisplay(JNIEnv* env,
const base::android::JavaParamRef<jobject>& jobject,
jint sdkDisplayId,
jint width,
jint height,
jfloat dipScale,
jint rotationDegrees,
jint bitsPerPixel,
jint bitsPerComponent,
jboolean isWideColorGamut);
void RemoveDisplay(JNIEnv* env,
const base::android::JavaParamRef<jobject>& jobject,
jint sdkDisplayId);
void SetPrimaryDisplayId(JNIEnv* env,
const base::android::JavaParamRef<jobject>& jobject,
jint sdkDisplayId);
friend class WindowAndroid;
friend void SetScreenAndroid();
static void DoUpdateDisplay(display::Display* display,
gfx::Size size_in_pixels,
float dipScale,
int rotationDegrees,
int bitsPerPixel,
int bitsPerComponent,
bool isWideColorGamut);
int primary_display_id_ = 0;
} // namespace ui