Skip to content

Commit

Permalink
6.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
SomeoneWeird committed Sep 19, 2018
1 parent 48ac7ad commit 0afb760
Show file tree
Hide file tree
Showing 172 changed files with 6,550 additions and 2,919 deletions.
6 changes: 3 additions & 3 deletions WKC/WTF/wtf/WKC/OSAllocatorWKC.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2011-2014 ACCESS CO., LTD. All rights reserved.
* Copyright (c) 2011-2017 ACCESS CO., LTD. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
Expand Down Expand Up @@ -60,13 +60,13 @@ OSAllocator::releaseDecommitted(void* ptr, size_t size)
void
OSAllocator::commit(void* ptr, size_t size, bool writable, bool executable)
{
wkcHeapCommitPeer(ptr, size, writable, executable);
// wkcHeapReserveUncommittedPeer returns commited memory, so we do nothing here.
}

void
OSAllocator::decommit(void* ptr, size_t size)
{
wkcHeapDecommitPeer(ptr, size);
// wkcHeapReleaseDecommittedPeer will decommit and release memory, so we do nothing here.
}

} // namespace
29 changes: 28 additions & 1 deletion WKC/WebCore/platform/graphics/WKC/FontWKC.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Copyright (C) 2007 Kevin Ollivier. All rights reserved.
* Copyright (C) 2014 Igalia S.L.
* Copyright (c) 2010-2017 ACCESS CO., LTD. All rights reserved.
* Copyright (c) 2010-2018 ACCESS CO., LTD. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
Expand Down Expand Up @@ -341,12 +341,39 @@ fixedGlyphs(int sch, bool isemoji, const UChar* str, int& len, bool& needfree)
}
for (int i=0; i<len; i++) {
const UChar c = str[i];
UChar c_next = 0;
if (i<(len-1))
c_next = str[i+1];
UChar c_prev = 0;
if (i>0)
c_prev = str[i-1];
UChar c_after_next = 0;
if (i<(len - 2))
c_after_next = str[i+2];

if (FontCascade::treatAsSpace(c)) {
buf[j++] = 0x20;
} else if (c==0x200d) {
buf[j++] = c;
} else if ((c==0x200b || FontCascade::treatAsZeroWidthSpace(c) || c==0xfeff)) {
buf[j++] = 0x200b;
// Instead of implementing Emoji variation sequences, temporarily convert Variation Selector-15 (U+fe0e) and Variation Selector-16 (U+feof) to zero width space (U+200b).
// If Variation Selector is followed by Zero Width Joiner (U+200d), don't convert to zero width space.
} else if ((c==0xfe0e || c==0xfe0f) && c_next!=0x200d) {
buf[j++] = 0x200b;
// Instead of implementing Emoji variation sequences, temporarily convert Variation Selector-15 (U+fe0e) and Variation Selector-16 (U+feof) to zero width space (U+200b).
// If Variation Selector is followed by Zero Width Joiner (U+200d) and Zero Width Joiner is followed by Gender Symbol (U+2640 or U+2642), convert to zero width space.
} else if ((c==0xfe0e || c==0xfe0f) && c_next==0x200d && (c_after_next==0x2640 || c_after_next==0x2642)) {
buf[j++] = 0x200b;
i++;
// Instead of implementing Emoji variation sequences, temporarily convert VS1 - VS14 (U+fe00 - U+fe0d) to zero width space (U+200b).
} else if (c>=0xfe00 && c<=0xfe0d) {
buf[j++] = 0x200b;
// Instead of implementing Emoji variation sequences, temporarily convert VS17 - VS256 (U+db40 U+dd00 - U+db40 U+ddef) to zero width spaces (U+200b U+200b).
} else if (c == 0xdb40 && c_next>=0xdd00 && c_next<=0xddef) {
buf[j++] = 0x200b;
} else if (c_prev == 0xdb40 && c>=0xdd00 && c<=0xddef) {
buf[j++] = 0x200b;
} else {
buf[j++] = c;
}
Expand Down
8 changes: 4 additions & 4 deletions WKC/WebCore/platform/graphics/WKC/GraphicsContextWKCCairo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* Copyright (C) 2010, 2011 Igalia S.L.
* Copyright (C) Research In Motion Limited 2010. All rights reserved.
* Copyright (C) 2012, Intel Corporation
* Copyright (c) 2011-2016 ACCESS CO., LTD. All rights reserved.
* Copyright (c) 2011-2018 ACCESS CO., LTD. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
Expand Down Expand Up @@ -467,7 +467,7 @@ static void drawLineOnCairoContext(GraphicsContext* graphicsContext, cairo_t* co
else if (style == DashedStroke)
patternWidth = 3 * strokeThickness;

bool isVerticalLine = (point1.x() + strokeThickness == point2.x());
bool isVerticalLine = (point1.x() + strokeThickness == point2.x()) && (point1.y() != point2.y());
FloatPoint point1OnPixelBoundaries = point1;
FloatPoint point2OnPixelBoundaries = point2;
if (strokeThickness==1) {
Expand Down Expand Up @@ -1265,9 +1265,9 @@ void GraphicsContext::clip(const Path& path, WindRule windRule)
m_data->clip(path);
}

void GraphicsContext::canvasClip(const Path& path, WindRule)
void GraphicsContext::canvasClip(const Path& path, WindRule windRule)
{
clip(path);
clip(path, windRule);
}

void GraphicsContext::clipOut(const Path& path)
Expand Down
9 changes: 8 additions & 1 deletion WKC/WebCore/platform/graphics/WKC/MediaPlayerPrivateWKC.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2011-2017 ACCESS CO., LTD. All rights reserved.
* Copyright (c) 2011-2018 ACCESS CO., LTD. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
Expand Down Expand Up @@ -420,6 +420,13 @@ MediaPlayerPrivate::currentTime() const
{
return wkcMediaPlayerCurrentTimePeer(m_peer);
}

double
MediaPlayerPrivate::currentTimeDouble() const
{
return wkcMediaPlayerCurrentTimeDoublePeer(m_peer);
}

void
MediaPlayerPrivate::seek(float in_time)
{
Expand Down
3 changes: 2 additions & 1 deletion WKC/WebCore/platform/graphics/WKC/MediaPlayerPrivateWKC.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2011-2017 ACCESS CO., LTD. All rights reserved.
* Copyright (c) 2011-2018 ACCESS CO., LTD. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
Expand Down Expand Up @@ -75,6 +75,7 @@ class MediaPlayerPrivate : public MediaPlayerPrivateInterface, public ResourceH
virtual double durationDouble() const;

virtual float currentTime() const;
virtual double currentTimeDouble() const;
virtual void seek(float time);
virtual bool seeking() const;

Expand Down
89 changes: 54 additions & 35 deletions WKC/WebCore/platform/graphics/WKC/SourceBufferPrivateWKC.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013-2016 ACCESS CO., LTD. All rights reserved.
* Copyright (c) 2013-2018 ACCESS CO., LTD. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
Expand Down Expand Up @@ -41,25 +41,41 @@ namespace WebCore {
// AudioTrackPrivate
class AudioTrackPrivateWKC : public AudioTrackPrivate {
public:
static PassRefPtr<AudioTrackPrivate> create()
static PassRefPtr<AudioTrackPrivate> create(int id)
{
return adoptRef(new AudioTrackPrivateWKC());
return adoptRef(new AudioTrackPrivateWKC(id));
}

virtual AtomicString id() const { return String::format("%d", 1); }
virtual AtomicString id() const { return m_id; }
virtual ~AudioTrackPrivateWKC() { }
protected:
AudioTrackPrivateWKC(int id)
: m_id(String::format("%d", id))
{
}

private:
AtomicString m_id;
};

// VideoTrackPrivate
class VideoTrackPrivateWKC : public VideoTrackPrivate {
public:
static PassRefPtr<VideoTrackPrivate> create()
static PassRefPtr<VideoTrackPrivate> create(int id)
{
return adoptRef(new VideoTrackPrivateWKC());
return adoptRef(new VideoTrackPrivateWKC(id));
}

virtual AtomicString id() const { return String::format("%d", 1); }
virtual AtomicString id() const { return m_id; }
virtual ~VideoTrackPrivateWKC() { }
protected:
VideoTrackPrivateWKC(int id)
: m_id(String::format("%d", id))
{
}

private:
AtomicString m_id;
};

// MediaDescription
Expand Down Expand Up @@ -88,7 +104,7 @@ class MediaDescriptionWKC : public MediaDescription {

class MediaSampleWKC : public MediaSample {
public:
static RefPtr<MediaSampleWKC> create(double presentationTime, double decodeTime, double duration) { return adoptRef(new MediaSampleWKC(presentationTime, decodeTime, duration)); }
static RefPtr<MediaSampleWKC> create(int id, int64_t presentationTime, int64_t decodeTime, int64_t duration) { return adoptRef(new MediaSampleWKC(id, presentationTime, decodeTime, duration)); }
virtual ~MediaSampleWKC() { }

virtual MediaTime presentationTime() const override { return m_presentationTime; }
Expand All @@ -105,11 +121,11 @@ class MediaSampleWKC : public MediaSample {
virtual void dump(PrintStream&) const { }

protected:
MediaSampleWKC(double presentationTime, double decodeTime, double duration)
: m_presentationTime(MediaTime::createWithDouble(presentationTime))
, m_decodeTime(MediaTime::createWithDouble(decodeTime))
, m_duration(MediaTime::createWithDouble(duration))
, m_trackID(String::format("%d", 1))
MediaSampleWKC(int id, int64_t presentationTime, int64_t decodeTime, int64_t duration)
: m_presentationTime(presentationTime, 1000000)
, m_decodeTime(decodeTime, 1000000)
, m_duration(duration, 1000000)
, m_trackID(String::format("%d", id))
{
}

Expand Down Expand Up @@ -220,9 +236,9 @@ SourceBufferPrivateWKC::isFull()
}

void
SourceBufferPrivateWKC::didReceiveInitializationSegmentProc(void* self, const char* in_codec, int in_kind, double in_duration)
SourceBufferPrivateWKC::didReceiveInitializationSegmentProc(void* self, const WKCMediaTrack* in_tracks, int in_tracks_len, double in_duration)
{
static_cast<SourceBufferPrivateWKC*>(self)->didReceiveInitializationSegment(in_codec, in_kind, in_duration);
static_cast<SourceBufferPrivateWKC*>(self)->didReceiveInitializationSegment(in_tracks, in_tracks_len, in_duration);
}

void
Expand All @@ -244,32 +260,35 @@ SourceBufferPrivateWKC::removeCodedFramesProc(void* self, double in_start, doubl
}

void
SourceBufferPrivateWKC::didReceiveInitializationSegment(const char* in_codec, int in_kind, double in_duration)
SourceBufferPrivateWKC::didReceiveInitializationSegment(const WKCMediaTrack* in_tracks, int in_tracks_len, double in_duration)
{
SourceBufferPrivateClient::InitializationSegment init_segment;

init_segment.duration = MediaTime::createWithDouble(in_duration);

switch (in_kind) {
case WKC_MEDIA_SB_TRACKKIND_AUDIO:
{
SourceBufferPrivateClient::InitializationSegment::AudioTrackInformation info;
info.description = MediaDescriptionWKC::create(in_codec, in_kind);
info.track = AudioTrackPrivateWKC::create();
init_segment.audioTracks.append(info);
}
break;
case WKC_MEDIA_SB_TRACKKIND_VIDEO:
{
SourceBufferPrivateClient::InitializationSegment::VideoTrackInformation info;
info.description = MediaDescriptionWKC::create(in_codec, in_kind);
info.track = VideoTrackPrivateWKC::create();
init_segment.videoTracks.append(info);
for (int i = 0; i < in_tracks_len; i++) {
switch (in_tracks[i].fKind) {
case WKC_MEDIA_SB_TRACKKIND_AUDIO:
{
SourceBufferPrivateClient::InitializationSegment::AudioTrackInformation info;
info.description = MediaDescriptionWKC::create(in_tracks[i].fCodec, in_tracks[i].fKind);
info.track = AudioTrackPrivateWKC::create(in_tracks[i].fID);
init_segment.audioTracks.append(info);
}
break;
case WKC_MEDIA_SB_TRACKKIND_VIDEO:
{
SourceBufferPrivateClient::InitializationSegment::VideoTrackInformation info;
info.description = MediaDescriptionWKC::create(in_tracks[i].fCodec, in_tracks[i].fKind);
info.track = VideoTrackPrivateWKC::create(in_tracks[i].fID);
init_segment.videoTracks.append(info);
}
break;
default:
break;
}
break;
default:
break;
}

if (m_client) {
m_client->sourceBufferPrivateDidReceiveInitializationSegment(this, init_segment);
}
Expand All @@ -282,7 +301,7 @@ SourceBufferPrivateWKC::didReceiveSamples(const WKCMediaSample* in_samples, int
return;
}
for (int i = 0; i < in_samples_len; i++) {
m_client->sourceBufferPrivateDidReceiveSample(this, MediaSampleWKC::create(in_samples[i].fPresentationTime, in_samples[i].fDecodeTime, in_samples[i].fDuration));
m_client->sourceBufferPrivateDidReceiveSample(this, MediaSampleWKC::create(in_samples[i].fID, in_samples[i].fPresentationTime, in_samples[i].fDecodeTime, in_samples[i].fDuration));
}
}

Expand Down
6 changes: 3 additions & 3 deletions WKC/WebCore/platform/graphics/WKC/SourceBufferPrivateWKC.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013-2016 ACCESS CO., LTD. All rights reserved.
* Copyright (c) 2013-2018 ACCESS CO., LTD. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
Expand Down Expand Up @@ -55,12 +55,12 @@ class SourceBufferPrivateWKC : public SourceBufferPrivate {
virtual void evictCodedFrames();
virtual bool isFull();

static void didReceiveInitializationSegmentProc(void* self, const char* in_codec, int in_kind, double in_duration);
static void didReceiveInitializationSegmentProc(void* self, const WKCMediaTrack* in_tracks, int in_tracks_len, double in_duration);
static void didReceiveSamplesProc(void* self, const WKCMediaSample* in_samples, int in_samples_len);
static void appendCompleteProc(void* self, int in_appendresult);
static void removeCodedFramesProc(void* self, double in_start, double in_end);

void didReceiveInitializationSegment(const char* in_codec, int in_kind, double in_duration);
void didReceiveInitializationSegment(const WKCMediaTrack* in_tracks, int in_tracks_len, double in_duration);
void didReceiveSamples(const WKCMediaSample* in_samples, int in_samples_len);
void appendComplete(int in_appendresult);
void removeCodedFrames(double in_start, double in_end);
Expand Down
Loading

0 comments on commit 0afb760

Please sign in to comment.