Bug 1584375. Remove unused origin from recording. r=nical

This was added as part of an intermediate step to blob
recoordination. It's not used anymore.

Differential Revision: https://phabricator.services.mozilla.com/D47354

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Jeff Muizelaar 2019-10-02 21:47:11 +00:00
Родитель 0498c437c9
Коммит b01dc0a82e
6 изменённых файлов: 13 добавлений и 23 удалений

Просмотреть файл

@ -90,8 +90,8 @@ DrawEventRecorderMemory::DrawEventRecorderMemory() {
} }
DrawEventRecorderMemory::DrawEventRecorderMemory( DrawEventRecorderMemory::DrawEventRecorderMemory(
const SerializeResourcesFn& aFn, IntPoint aOrigin) const SerializeResourcesFn& aFn)
: mSerializeCallback(aFn), mOrigin(aOrigin) { : mSerializeCallback(aFn) {
mExternalFonts = !!mSerializeCallback; mExternalFonts = !!mSerializeCallback;
WriteHeader(mOutputStream); WriteHeader(mOutputStream);
} }
@ -132,7 +132,6 @@ bool DrawEventRecorderMemory::Finish() {
mIndex = MemStream(); mIndex = MemStream();
// write out the offset of the Index to the end of the output stream // write out the offset of the Index to the end of the output stream
WriteElement(mOutputStream, indexOffset); WriteElement(mOutputStream, indexOffset);
WriteElement(mOutputStream, mOrigin);
ClearResources(); ClearResources();
return hasItems; return hasItems;
} }

Просмотреть файл

@ -179,8 +179,7 @@ class DrawEventRecorderMemory : public DrawEventRecorderPrivate {
* Constructs a DrawEventRecorder that stores the recording in memory. * Constructs a DrawEventRecorder that stores the recording in memory.
*/ */
DrawEventRecorderMemory(); DrawEventRecorderMemory();
explicit DrawEventRecorderMemory(const SerializeResourcesFn& aSerialize, explicit DrawEventRecorderMemory(const SerializeResourcesFn& aSerialize);
IntPoint aOrigin = IntPoint());
void RecordEvent(const RecordedEvent& aEvent) override; void RecordEvent(const RecordedEvent& aEvent) override;
@ -217,7 +216,6 @@ class DrawEventRecorderMemory : public DrawEventRecorderPrivate {
private: private:
SerializeResourcesFn mSerializeCallback; SerializeResourcesFn mSerializeCallback;
nsTHashtable<nsUint64HashKey> mDependentSurfaces; nsTHashtable<nsUint64HashKey> mDependentSurfaces;
IntPoint mOrigin;
void Flush() override; void Flush() override;
}; };

Просмотреть файл

@ -659,8 +659,7 @@ struct DIGroup {
aStream.write((const char*)&font, sizeof(font)); aStream.write((const char*)&font, sizeof(font));
} }
fonts = std::move(aScaledFonts); fonts = std::move(aScaledFonts);
}, });
mVisibleRect.ToUnknownRect().TopLeft());
RefPtr<gfx::DrawTarget> dummyDt = gfx::Factory::CreateDrawTarget( RefPtr<gfx::DrawTarget> dummyDt = gfx::Factory::CreateDrawTarget(
gfx::BackendType::SKIA, gfx::IntSize(1, 1), format); gfx::BackendType::SKIA, gfx::IntSize(1, 1), format);
@ -2259,8 +2258,7 @@ WebRenderCommandBuilder::GenerateFallbackData(
aStream.write((const char*)&font, sizeof(font)); aStream.write((const char*)&font, sizeof(font));
} }
fonts = std::move(aScaledFonts); fonts = std::move(aScaledFonts);
}, });
visibleRect.ToUnknownRect().TopLeft());
RefPtr<gfx::DrawTarget> dummyDt = gfx::Factory::CreateDrawTarget( RefPtr<gfx::DrawTarget> dummyDt = gfx::Factory::CreateDrawTarget(
gfx::BackendType::SKIA, gfx::IntSize(1, 1), format); gfx::BackendType::SKIA, gfx::IntSize(1, 1), format);
RefPtr<gfx::DrawTarget> dt = gfx::Factory::CreateRecordingDrawTarget( RefPtr<gfx::DrawTarget> dt = gfx::Factory::CreateRecordingDrawTarget(
@ -2491,8 +2489,7 @@ Maybe<wr::ImageMask> WebRenderCommandBuilder::BuildWrMaskImage(
} }
fonts = std::move(aScaledFonts); fonts = std::move(aScaledFonts);
}, });
IntPoint(0, 0));
RefPtr<DrawTarget> dummyDt = Factory::CreateDrawTarget( RefPtr<DrawTarget> dummyDt = Factory::CreateDrawTarget(
BackendType::SKIA, IntSize(1, 1), SurfaceFormat::A8); BackendType::SKIA, IntSize(1, 1), SurfaceFormat::A8);

Просмотреть файл

@ -9,7 +9,6 @@
#include "mozilla/gfx/DrawEventRecorder.h" #include "mozilla/gfx/DrawEventRecorder.h"
#include "mozilla/gfx/InlineTranslator.h" #include "mozilla/gfx/InlineTranslator.h"
#include "mozilla/webrender/webrender_ffi.h" #include "mozilla/webrender/webrender_ffi.h"
#include "mozilla/gfx/Point.h"
namespace mozilla { namespace mozilla {
namespace layers { namespace layers {
@ -24,8 +23,8 @@ class WebRenderDrawEventRecorder final : public gfx::DrawEventRecorderMemory {
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(WebRenderDrawEventRecorder, final) MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(WebRenderDrawEventRecorder, final)
explicit WebRenderDrawEventRecorder( explicit WebRenderDrawEventRecorder(
const gfx::SerializeResourcesFn& aSerialize, gfx::IntPoint aOrigin) const gfx::SerializeResourcesFn& aSerialize)
: DrawEventRecorderMemory(aSerialize, aOrigin) {} : DrawEventRecorderMemory(aSerialize) {}
void StoreSourceSurfaceRecording(gfx::SourceSurface* aSurface, void StoreSourceSurfaceRecording(gfx::SourceSurface* aSurface,
const char* aReason) final; const char* aReason) final;

Просмотреть файл

@ -367,7 +367,7 @@ static bool Moz2DRenderCallback(const Range<const uint8_t> aBlob,
// We try hard to not have empty blobs but we can end up with // We try hard to not have empty blobs but we can end up with
// them because of CompositorHitTestInfo and merging. // them because of CompositorHitTestInfo and merging.
size_t footerSize = sizeof(size_t) + sizeof(IntPoint); size_t footerSize = sizeof(size_t);
MOZ_RELEASE_ASSERT(aBlob.length() >= footerSize); MOZ_RELEASE_ASSERT(aBlob.length() >= footerSize);
size_t indexOffset = ConvertFromBytes<size_t>(aBlob.end().get() - footerSize); size_t indexOffset = ConvertFromBytes<size_t>(aBlob.end().get() - footerSize);

Просмотреть файл

@ -172,7 +172,6 @@ struct BlobReader<'a> {
reader: BufReader<'a>, reader: BufReader<'a>,
/// Where the buffer head is. /// Where the buffer head is.
begin: usize, begin: usize,
origin: IntPoint,
} }
#[derive(PartialEq, Debug, Eq, Clone, Copy)] #[derive(PartialEq, Debug, Eq, Clone, Copy)]
@ -200,12 +199,11 @@ impl<'a> BlobReader<'a> {
/// Creates a new BlobReader for the given buffer. /// Creates a new BlobReader for the given buffer.
fn new(buf: &'a[u8]) -> BlobReader<'a> { fn new(buf: &'a[u8]) -> BlobReader<'a> {
// The offset of the index is at the end of the buffer. // The offset of the index is at the end of the buffer.
let index_offset_pos = buf.len()-(mem::size_of::<usize>() + mem::size_of::<IntPoint>()); let index_offset_pos = buf.len()-mem::size_of::<usize>();
assert!(index_offset_pos < buf.len()); assert!(index_offset_pos < buf.len());
let index_offset = unsafe { convert_from_bytes::<usize>(&buf[index_offset_pos..]) }; let index_offset = unsafe { convert_from_bytes::<usize>(&buf[index_offset_pos..]) };
let origin = unsafe { convert_from_bytes(&buf[(index_offset_pos + mem::size_of::<usize>())..]) };
BlobReader { reader: BufReader::new(&buf[index_offset..index_offset_pos]), begin: 0, origin } BlobReader { reader: BufReader::new(&buf[index_offset..index_offset_pos]), begin: 0}
} }
/// Reads the next display item's metadata. /// Reads the next display item's metadata.
@ -251,13 +249,12 @@ impl BlobWriter {
} }
/// Completes the blob image, producing a single buffer containing it. /// Completes the blob image, producing a single buffer containing it.
fn finish(mut self, origin: IntPoint) -> Vec<u8> { fn finish(mut self) -> Vec<u8> {
// Append the index to the end of the buffer // Append the index to the end of the buffer
// and then append the offset to the beginning of the index. // and then append the offset to the beginning of the index.
let index_begin = self.data.len(); let index_begin = self.data.len();
self.data.extend_from_slice(&self.index); self.data.extend_from_slice(&self.index);
self.data.extend_from_slice(convert_to_bytes(&index_begin)); self.data.extend_from_slice(convert_to_bytes(&index_begin));
self.data.extend_from_slice(convert_to_bytes(&origin));
self.data self.data
} }
} }
@ -461,7 +458,7 @@ fn merge_blob_images(old_buf: &[u8], new_buf: &[u8], dirty_rect: Box2d, old_visi
//assert!(old_reader.cache.is_empty()); //assert!(old_reader.cache.is_empty());
let result = result.finish(new_reader.origin); let result = result.finish();
dump_index(&result); dump_index(&result);
result result
} }