Skip to content

Commit 7dbd9f8

Browse files
[ONEM-32126]: WPE 2.38 - Silent for few seconds after rewind was performed
1 parent fd58609 commit 7dbd9f8

File tree

5 files changed

+30
-4
lines changed

5 files changed

+30
-4
lines changed

Source/WebCore/html/HTMLMediaElement.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3764,6 +3764,12 @@ void HTMLMediaElement::playInternal()
37643764
return;
37653765
}
37663766

3767+
ALWAYS_LOG(LOGIDENTIFIER, "suresh m_seekRequested:", m_seekRequested, "wasSeeking:" , wasSeeking);
3768+
if (m_seekRequested) {
3769+
ALWAYS_LOG(LOGIDENTIFIER, "suresh no need to change the playstate");
3770+
return;
3771+
}
3772+
37673773
// 4.8.10.9. Playing the media resource
37683774
if (!m_player || m_networkState == NETWORK_EMPTY)
37693775
selectMediaResource();

Source/WebCore/platform/graphics/cairo/CairoUtilities.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
#include <wtf/NeverDestroyed.h>
4343
#include <wtf/UniqueArray.h>
4444
#include <wtf/Vector.h>
45+
#include <wtf/Atomics.h>
4546

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

5859
namespace WebCore {
5960

61+
static cairo_user_data_key_t s_surfaceUniqueIDKey;
62+
static Atomic<uintptr_t> s_surfaceUniqueID = 1;
63+
6064
#if USE(FREETYPE)
6165
RecursiveLock& cairoFontLock()
6266
{
@@ -403,6 +407,16 @@ void renderingStarted()
403407
}
404408
}
405409

410+
void attachSurfaceUniqueID(cairo_surface_t* surface)
411+
{
412+
cairo_surface_set_user_data(surface, &s_surfaceUniqueIDKey, reinterpret_cast<void*>(s_surfaceUniqueID.exchangeAdd(1)), nullptr);
413+
}
414+
415+
uintptr_t getSurfaceUniqueID(cairo_surface_t* surface)
416+
{
417+
return reinterpret_cast<uintptr_t>(cairo_surface_get_user_data(surface, &s_surfaceUniqueIDKey));
418+
}
419+
406420
} // namespace WebCore
407421

408422
#endif // USE(CAIRO)

Source/WebCore/platform/graphics/cairo/CairoUtilities.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ void flipImageSurfaceVertically(cairo_surface_t*);
9898
RefPtr<cairo_region_t> toCairoRegion(const Region&);
9999

100100
cairo_matrix_t toCairoMatrix(const AffineTransform&);
101+
void attachSurfaceUniqueID(cairo_surface_t*);
102+
uintptr_t getSurfaceUniqueID(cairo_surface_t*);
101103

102104
void resetRenderingStartedFlag();
103105
void setRenderingStartedFlag();

Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#include "CoordinatedGraphicsLayer.h"
2626

2727
#if USE(COORDINATED_GRAPHICS)
28-
28+
#include "CairoUtilities.h"
2929
#include "FloatQuad.h"
3030
#include "GraphicsContext.h"
3131
#include "GraphicsLayer.h"
@@ -903,7 +903,9 @@ void CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly()
903903
ASSERT(m_compositedImage);
904904
auto& image = *m_compositedImage;
905905
uintptr_t imageID = reinterpret_cast<uintptr_t>(&image);
906-
uintptr_t nativeImageID = reinterpret_cast<uintptr_t>(m_compositedNativeImage->platformImage().get());
906+
//uintptr_t nativeImageID = reinterpret_cast<uintptr_t>(m_compositedNativeImage->platformImage().get());
907+
908+
uintptr_t nativeImageID = getSurfaceUniqueID(m_compositedNativeImage->platformImage().get());
907909

908910
// Respawn the ImageBacking object if the underlying image changed.
909911
if (m_nicosia.imageBacking) {
@@ -923,7 +925,8 @@ void CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly()
923925
auto& layerState = impl.layerState();
924926
layerState.imageID = imageID;
925927
layerState.update.isVisible = transformedVisibleRect().intersects(IntRect(contentsRect()));
926-
if (layerState.update.isVisible && layerState.update.nativeImageID != nativeImageID) {
928+
if (layerState.update.isVisible && (!nativeImageID || layerState.update.nativeImageID != nativeImageID)) {
929+
//if (layerState.update.isVisible && layerState.update.nativeImageID != nativeImageID) {
927930
layerState.update.nativeImageID = nativeImageID;
928931
layerState.update.imageBackingStore = m_coordinator->imageBackingStore(nativeImageID,
929932
[&] {

Source/WebCore/platform/image-decoders/cairo/ImageBackingStoreCairo.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
*/
2525

2626
#include "config.h"
27+
#include "CairoUtilities.h"
2728
#include "ImageBackingStore.h"
2829

2930
#include <cairo.h>
@@ -43,5 +44,5 @@ PlatformImagePtr ImageBackingStore::image() const
4344

4445
return surface;
4546
}
46-
47+
attachSurfaceUniqueID(surface.get());
4748
} // namespace WebCore

0 commit comments

Comments
 (0)