mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-22 09:45:41 +00:00
Bug 1607697 - Pass-by-value clippy lints for some small structures. r=Gankro
Differential Revision: https://phabricator.services.mozilla.com/D59116 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
e78fd8f034
commit
00a1d72d5c
@ -125,7 +125,7 @@ impl PrimitiveOpacity {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn combine(&self, other: PrimitiveOpacity) -> PrimitiveOpacity {
|
||||
pub fn combine(self, other: PrimitiveOpacity) -> PrimitiveOpacity {
|
||||
PrimitiveOpacity{
|
||||
is_opaque: self.is_opaque && other.is_opaque
|
||||
}
|
||||
@ -378,13 +378,13 @@ impl ClipTaskIndex {
|
||||
pub struct PictureIndex(pub usize);
|
||||
|
||||
impl GpuCacheHandle {
|
||||
pub fn as_int(&self, gpu_cache: &GpuCache) -> i32 {
|
||||
pub fn as_int(self, gpu_cache: &GpuCache) -> i32 {
|
||||
gpu_cache.get_address(self).as_int()
|
||||
}
|
||||
}
|
||||
|
||||
impl GpuCacheAddress {
|
||||
pub fn as_int(&self) -> i32 {
|
||||
pub fn as_int(self) -> i32 {
|
||||
// TODO(gw): Temporarily encode GPU Cache addresses as a single int.
|
||||
// In the future, we can change the PrimitiveInstanceData struct
|
||||
// to use 2x u16 for the vertex attribute instead of an i32.
|
||||
|
@ -1632,19 +1632,19 @@ impl RenderBackend {
|
||||
serde_json::to_string(&debug_root).unwrap()
|
||||
}
|
||||
|
||||
fn report_memory(&mut self, tx: MsgSender<MemoryReport>) {
|
||||
let mut report = MemoryReport::default();
|
||||
fn report_memory(&mut self, tx: MsgSender<Box<MemoryReport>>) {
|
||||
let mut report = Box::new(MemoryReport::default());
|
||||
let ops = self.size_of_ops.as_mut().unwrap();
|
||||
let op = ops.size_of_op;
|
||||
report.gpu_cache_metadata = self.gpu_cache.size_of(ops);
|
||||
for (_id, doc) in &self.documents {
|
||||
for doc in self.documents.values() {
|
||||
report.clip_stores += doc.scene.clip_store.size_of(ops);
|
||||
report.hit_testers += doc.hit_tester.size_of(ops);
|
||||
|
||||
doc.data_stores.report_memory(ops, &mut report)
|
||||
}
|
||||
|
||||
report += self.resource_cache.report_memory(op);
|
||||
(*report) += self.resource_cache.report_memory(op);
|
||||
|
||||
// Send a message to report memory on the scene-builder thread, which
|
||||
// will add its report to this one and send the result back to the original
|
||||
@ -1885,7 +1885,7 @@ impl RenderBackend {
|
||||
|
||||
scenes_to_build.push(LoadScene {
|
||||
document_id: id,
|
||||
scene: scene,
|
||||
scene,
|
||||
view: view.clone(),
|
||||
config: self.frame_config.clone(),
|
||||
output_pipelines: doc.output_pipelines.clone(),
|
||||
|
@ -3930,7 +3930,7 @@ impl Renderer {
|
||||
.iter()
|
||||
.rev()
|
||||
{
|
||||
if should_skip_batch(&batch.key.kind, &self.debug_flags) {
|
||||
if should_skip_batch(&batch.key.kind, self.debug_flags) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -3981,7 +3981,7 @@ impl Renderer {
|
||||
}
|
||||
|
||||
for batch in &alpha_batch_container.alpha_batches {
|
||||
if should_skip_batch(&batch.key.kind, &self.debug_flags) {
|
||||
if should_skip_batch(&batch.key.kind, self.debug_flags) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -6784,7 +6784,7 @@ enum FramebufferKind {
|
||||
Other,
|
||||
}
|
||||
|
||||
fn should_skip_batch(kind: &BatchKind, flags: &DebugFlags) -> bool {
|
||||
fn should_skip_batch(kind: &BatchKind, flags: DebugFlags) -> bool {
|
||||
match kind {
|
||||
BatchKind::TextRun(_) => {
|
||||
flags.contains(DebugFlags::DISABLE_TEXT_PRIMS)
|
||||
|
@ -400,7 +400,7 @@ impl ImageResult {
|
||||
entry.mark_unused(texture_cache);
|
||||
},
|
||||
ImageResult::Multi(ref mut entries) => {
|
||||
for (_, entry) in &mut entries.resources {
|
||||
for entry in entries.resources.values_mut() {
|
||||
entry.mark_unused(texture_cache);
|
||||
}
|
||||
},
|
||||
|
@ -60,7 +60,7 @@ impl<T> Range<T> {
|
||||
}
|
||||
|
||||
/// Check for an empty `Range`
|
||||
pub fn is_empty(&self) -> bool {
|
||||
pub fn is_empty(self) -> bool {
|
||||
self.start.0 >= self.end.0
|
||||
}
|
||||
}
|
||||
|
@ -988,7 +988,7 @@ impl TextureCache {
|
||||
// If the swizzling is supported, we always upload in the internal
|
||||
// texture format (thus avoiding the conversion by the driver).
|
||||
// Otherwise, pass the external format to the driver.
|
||||
let use_upload_format = !self.swizzle.is_some();
|
||||
let use_upload_format = self.swizzle.is_none();
|
||||
let (layer_index, origin) = entry.details.describe();
|
||||
let op = TextureCacheUpdate::new_update(
|
||||
data,
|
||||
|
Loading…
Reference in New Issue
Block a user