Skip to content

Commit

Permalink
[ONEM-32126]: WPE 2.38 - Silent for few seconds after rewind was perf…
Browse files Browse the repository at this point in the history
…ormed
  • Loading branch information
suresh-khurdiya-epam committed Dec 18, 2023
1 parent fd58609 commit 7dbd9f8
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 4 deletions.
6 changes: 6 additions & 0 deletions Source/WebCore/html/HTMLMediaElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3764,6 +3764,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 @@ -43,5 +44,5 @@ PlatformImagePtr ImageBackingStore::image() const

return surface;
}

attachSurfaceUniqueID(surface.get());
} // namespace WebCore

0 comments on commit 7dbd9f8

Please sign in to comment.