Skip to content

Commit

Permalink
Compile ui/gfx on Fuchsia
Browse files Browse the repository at this point in the history
1. Added stubs for typedefs in native_widget_types.h
2. Updated skia/ext/platform_canvas.h to define
   CreatePlatformCanvasWithPixels on Fuchsia

Bug: 731302
Change-Id: Ibfcb3d522ff87d24c17677be8f09e7f3b3a9d9a6
Reviewed-on: https://chromium-review.googlesource.com/557219
Commit-Queue: Sergey Ulanov <sergeyu@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#483569}
  • Loading branch information
SergeyUlanov authored and Commit Bot committed Jun 30, 2017
1 parent 3eebff0 commit f11c151
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
7 changes: 4 additions & 3 deletions skia/ext/platform_canvas.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,10 @@ SK_API std::unique_ptr<SkCanvas> CreatePlatformCanvasWithSharedSection(
SK_API HDC GetNativeDrawingContext(SkCanvas* canvas);

#elif defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__) || \
defined(__sun) || defined(ANDROID) || defined(__APPLE__)
// Construct a canvas from the given memory region. The memory is not cleared
// first. @data must be, at least, @height * StrideForWidth(@width) bytes.
defined(__sun) || defined(ANDROID) || defined(__APPLE__) || \
defined(__Fuchsia__)
// Construct a canvas from the given memory region. The memory is not cleared
// first. @data must be, at least, @height * StrideForWidth(@width) bytes.
SK_API std::unique_ptr<SkCanvas> CreatePlatformCanvasWithPixels(
int width,
int height,
Expand Down
10 changes: 10 additions & 0 deletions ui/gfx/native_widget_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,12 @@ typedef void* NativeCursor;
typedef ui::ViewAndroid* NativeView;
typedef ui::WindowAndroid* NativeWindow;
typedef jobject NativeEvent;
#elif defined(OS_FUCHSIA)
// TODO(fuchsia): Update when we have a plan for UI on Fuchsia.
typedef void* NativeCursor;
typedef void* NativeView;
typedef void* NativeWindow;
typedef void* NativeEvent;
#else
#error Unknown build environment.
#endif
Expand Down Expand Up @@ -197,6 +203,10 @@ constexpr AcceleratedWidget kNullAcceleratedWidget = 0;
#elif defined(USE_OZONE)
typedef int32_t AcceleratedWidget;
constexpr AcceleratedWidget kNullAcceleratedWidget = 0;
#elif defined(OS_FUCHSIA)
// TODO(fuchsia): Update when we have a plan for UI on Fuchsia.
typedef void* AcceleratedWidget;
constexpr AcceleratedWidget kNullAcceleratedWidget = 0;
#else
#error unknown platform
#endif
Expand Down

0 comments on commit f11c151

Please sign in to comment.