Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2441)

Unified Diff: cc/output/software_renderer.cc

Issue 93663004: [#2] Pass gfx structs by const ref (gfx::Rect, gfx::RectF) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase to ToT, fix builds on non-linux platforms! Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/output/software_renderer.h ('k') | cc/quads/checkerboard_draw_quad.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/output/software_renderer.cc
diff --git a/cc/output/software_renderer.cc b/cc/output/software_renderer.cc
index 84f6f1ea87049b5be30fcc97bac79f30fc793f90..7a0593dee4e36b9da12d7a3e1dcadb1c9e80e8a4 100644
--- a/cc/output/software_renderer.cc
+++ b/cc/output/software_renderer.cc
@@ -157,7 +157,7 @@ void SoftwareRenderer::BindFramebufferToOutputSurface(DrawingFrame* frame) {
bool SoftwareRenderer::BindFramebufferToTexture(
DrawingFrame* frame,
const ScopedResource* texture,
- gfx::Rect target_rect) {
+ const gfx::Rect& target_rect) {
current_framebuffer_lock_.reset();
current_framebuffer_lock_ = make_scoped_ptr(
new ResourceProvider::ScopedWriteLockSoftware(
@@ -170,13 +170,13 @@ bool SoftwareRenderer::BindFramebufferToTexture(
return true;
}
-void SoftwareRenderer::SetScissorTestRect(gfx::Rect scissor_rect) {
+void SoftwareRenderer::SetScissorTestRect(const gfx::Rect& scissor_rect) {
is_scissor_enabled_ = true;
scissor_rect_ = scissor_rect;
SetClipRect(scissor_rect);
}
-void SoftwareRenderer::SetClipRect(gfx::Rect rect) {
+void SoftwareRenderer::SetClipRect(const gfx::Rect& rect) {
// Skia applies the current matrix to clip rects so we reset it temporary.
SkMatrix current_matrix = current_canvas_->getTotalMatrix();
current_canvas_->resetMatrix();
@@ -209,7 +209,8 @@ void SoftwareRenderer::ClearFramebuffer(DrawingFrame* frame,
}
}
-void SoftwareRenderer::SetDrawViewport(gfx::Rect window_space_viewport) {}
+void SoftwareRenderer::SetDrawViewport(
+ const gfx::Rect& window_space_viewport) {}
bool SoftwareRenderer::IsSoftwareResource(
ResourceProvider::ResourceId resource_id) const {
@@ -587,14 +588,16 @@ void SoftwareRenderer::EnsureBackbuffer() {
is_backbuffer_discarded_ = false;
}
-void SoftwareRenderer::GetFramebufferPixels(void* pixels, gfx::Rect rect) {
+void SoftwareRenderer::GetFramebufferPixels(void* pixels,
+ const gfx::Rect& rect) {
TRACE_EVENT0("cc", "SoftwareRenderer::GetFramebufferPixels");
SkBitmap subset_bitmap;
- rect += current_viewport_rect_.OffsetFromOrigin();
- output_device_->CopyToBitmap(rect, &subset_bitmap);
+ gfx::Rect frame_rect(rect);
+ frame_rect += current_viewport_rect_.OffsetFromOrigin();
+ output_device_->CopyToBitmap(frame_rect, &subset_bitmap);
subset_bitmap.copyPixelsTo(pixels,
- 4 * rect.width() * rect.height(),
- 4 * rect.width());
+ 4 * frame_rect.width() * frame_rect.height(),
+ 4 * frame_rect.width());
}
void SoftwareRenderer::SetVisible(bool visible) {
« no previous file with comments | « cc/output/software_renderer.h ('k') | cc/quads/checkerboard_draw_quad.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698