Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ONEM-32126]: WPE 2.38 - Silent for few seconds after rewind was perf… #360

Open
wants to merge 1 commit into
base: lgi-wpe-2.38-23Q3
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Source/WebCore/html/HTMLMediaElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3747,6 +3747,7 @@ void HTMLMediaElement::play()
void HTMLMediaElement::playInternal()
{
ALWAYS_LOG(LOGIDENTIFIER);
bool wasSeeking = seeking();

if (isSuspended()) {
ALWAYS_LOG(LOGIDENTIFIER, "returning because context is suspended");
Expand All @@ -3764,6 +3765,12 @@ void HTMLMediaElement::playInternal()
return;
}

ALWAYS_LOG(LOGIDENTIFIER, "suresh m_seekRequested:", m_seekRequested, "wasSeeking:" , wasSeeking);
if (m_seekRequested) {
ALWAYS_LOG(LOGIDENTIFIER, "suresh no need to change the playstate");
return;
}

// 4.8.10.9. Playing the media resource
if (!m_player || m_networkState == NETWORK_EMPTY)
selectMediaResource();
Expand Down
14 changes: 14 additions & 0 deletions Source/WebCore/platform/graphics/cairo/CairoUtilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
#include <wtf/NeverDestroyed.h>
#include <wtf/UniqueArray.h>
#include <wtf/Vector.h>
#include <wtf/Atomics.h>

#if ENABLE(ACCELERATED_2D_CANVAS)
#include <cairo-gl.h>
Expand All @@ -57,6 +58,9 @@ namespace {

namespace WebCore {

static cairo_user_data_key_t s_surfaceUniqueIDKey;
static Atomic<uintptr_t> s_surfaceUniqueID = 1;

#if USE(FREETYPE)
RecursiveLock& cairoFontLock()
{
Expand Down Expand Up @@ -403,6 +407,16 @@ void renderingStarted()
}
}

void attachSurfaceUniqueID(cairo_surface_t* surface)
{
cairo_surface_set_user_data(surface, &s_surfaceUniqueIDKey, reinterpret_cast<void*>(s_surfaceUniqueID.exchangeAdd(1)), nullptr);
}

uintptr_t getSurfaceUniqueID(cairo_surface_t* surface)
{
return reinterpret_cast<uintptr_t>(cairo_surface_get_user_data(surface, &s_surfaceUniqueIDKey));
}

} // namespace WebCore

#endif // USE(CAIRO)
2 changes: 2 additions & 0 deletions Source/WebCore/platform/graphics/cairo/CairoUtilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ void flipImageSurfaceVertically(cairo_surface_t*);
RefPtr<cairo_region_t> toCairoRegion(const Region&);

cairo_matrix_t toCairoMatrix(const AffineTransform&);
void attachSurfaceUniqueID(cairo_surface_t*);
uintptr_t getSurfaceUniqueID(cairo_surface_t*);

void resetRenderingStartedFlag();
void setRenderingStartedFlag();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include "CoordinatedGraphicsLayer.h"

#if USE(COORDINATED_GRAPHICS)

#include "CairoUtilities.h"
#include "FloatQuad.h"
#include "GraphicsContext.h"
#include "GraphicsLayer.h"
Expand Down Expand Up @@ -903,7 +903,9 @@ void CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly()
ASSERT(m_compositedImage);
auto& image = *m_compositedImage;
uintptr_t imageID = reinterpret_cast<uintptr_t>(&image);
uintptr_t nativeImageID = reinterpret_cast<uintptr_t>(m_compositedNativeImage->platformImage().get());
//uintptr_t nativeImageID = reinterpret_cast<uintptr_t>(m_compositedNativeImage->platformImage().get());

uintptr_t nativeImageID = getSurfaceUniqueID(m_compositedNativeImage->platformImage().get());

// Respawn the ImageBacking object if the underlying image changed.
if (m_nicosia.imageBacking) {
Expand All @@ -923,7 +925,8 @@ void CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly()
auto& layerState = impl.layerState();
layerState.imageID = imageID;
layerState.update.isVisible = transformedVisibleRect().intersects(IntRect(contentsRect()));
if (layerState.update.isVisible && layerState.update.nativeImageID != nativeImageID) {
if (layerState.update.isVisible && (!nativeImageID || layerState.update.nativeImageID != nativeImageID)) {
//if (layerState.update.isVisible && layerState.update.nativeImageID != nativeImageID) {
layerState.update.nativeImageID = nativeImageID;
layerState.update.imageBackingStore = m_coordinator->imageBackingStore(nativeImageID,
[&] {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
*/

#include "config.h"
#include "CairoUtilities.h"
#include "ImageBackingStore.h"

#include <cairo.h>
Expand All @@ -41,7 +42,7 @@ PlatformImagePtr ImageBackingStore::image() const
static_cast<DataSegment*>(data)->deref();
});

attachSurfaceUniqueID(surface.get());
return surface;
}

} // namespace WebCore