mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Cleans up header order/grouping for consistency: associated header, C/C++ system/standard library headers, library headers, platform-specific #includes. Adds <cstring> where strlen, memcpy are being used: there are a bunch of places we use them transitively. Applies linter-required cleanups. Disables linter on one file due to included RapidJson header. See https://github.com/flutter/flutter/issues/65676 This patch does not cover flutter/shell/platform/darwin. There's a separate, slightly more intensive cleanup for those in progress.
52 lines
1.3 KiB
C++
52 lines
1.3 KiB
C++
// Copyright 2013 The Flutter Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
#ifndef FLUTTER_SHELL_PLATFORM_ANDROID_ANDROID_NATIVE_WINDOW_H_
|
|
#define FLUTTER_SHELL_PLATFORM_ANDROID_ANDROID_NATIVE_WINDOW_H_
|
|
|
|
#include "flutter/fml/build_config.h"
|
|
|
|
#include "flutter/fml/macros.h"
|
|
#include "flutter/fml/memory/ref_counted.h"
|
|
#include "third_party/skia/include/core/SkSize.h"
|
|
|
|
#if OS_ANDROID
|
|
#include <android/native_window.h>
|
|
#endif // OS_ANDROID
|
|
|
|
namespace flutter {
|
|
|
|
class AndroidNativeWindow
|
|
: public fml::RefCountedThreadSafe<AndroidNativeWindow> {
|
|
public:
|
|
#if OS_ANDROID
|
|
using Handle = ANativeWindow*;
|
|
#else // OS_ANDROID
|
|
using Handle = std::nullptr_t;
|
|
#endif // OS_ANDROID
|
|
|
|
bool IsValid() const;
|
|
|
|
Handle handle() const;
|
|
|
|
SkISize GetSize() const;
|
|
|
|
private:
|
|
Handle window_;
|
|
|
|
/// Creates a native window with the given handle. Handle ownership is assumed
|
|
/// by this instance of the native window.
|
|
explicit AndroidNativeWindow(Handle window);
|
|
|
|
~AndroidNativeWindow();
|
|
|
|
FML_FRIEND_MAKE_REF_COUNTED(AndroidNativeWindow);
|
|
FML_FRIEND_REF_COUNTED_THREAD_SAFE(AndroidNativeWindow);
|
|
FML_DISALLOW_COPY_AND_ASSIGN(AndroidNativeWindow);
|
|
};
|
|
|
|
} // namespace flutter
|
|
|
|
#endif // FLUTTER_SHELL_PLATFORM_ANDROID_ANDROID_NATIVE_WINDOW_H_
|