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 16:42:24 +00:00
Родитель 458e27120e
Коммит 20983ff87e
5 изменённых файлов: 11 добавлений и 21 удалений

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

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

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

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

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

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

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

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

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

@ -172,7 +172,6 @@ struct BlobReader<'a> {
reader: BufReader<'a>,
/// Where the buffer head is.
begin: usize,
origin: IntPoint,
}
#[derive(PartialEq, Debug, Eq, Clone, Copy)]
@ -203,9 +202,8 @@ impl<'a> BlobReader<'a> {
let index_offset_pos = buf.len()-(mem::size_of::<usize>() + mem::size_of::<IntPoint>());
assert!(index_offset_pos < buf.len());
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.
@ -251,13 +249,12 @@ impl BlobWriter {
}
/// 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
// and then append the offset to the beginning of the index.
let index_begin = self.data.len();
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(&origin));
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());
let result = result.finish(new_reader.origin);
let result = result.finish();
dump_index(&result);
result
}