зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
0498c437c9
Коммит
b01dc0a82e
|
@ -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;
|
||||
};
|
||||
|
|
|
@ -659,8 +659,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);
|
||||
|
@ -2259,8 +2258,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(
|
||||
|
@ -2491,8 +2489,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;
|
||||
|
|
|
@ -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
|
||||
// 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);
|
||||
size_t indexOffset = ConvertFromBytes<size_t>(aBlob.end().get() - footerSize);
|
||||
|
||||
|
|
|
@ -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)]
|
||||
|
@ -200,12 +199,11 @@ impl<'a> BlobReader<'a> {
|
|||
/// Creates a new BlobReader for the given buffer.
|
||||
fn new(buf: &'a[u8]) -> BlobReader<'a> {
|
||||
// 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());
|
||||
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
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче