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

Side by Side Diff: cc/output/software_renderer.cc

Issue 2572833002: stop using exotic clipops (Closed)
Patch Set: cleaner SkUserConfig.h edit Created 4 years 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 unified diff | Download patch
« no previous file with comments | « no previous file | cc/playback/display_item_list_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/output/software_renderer.h" 5 #include "cc/output/software_renderer.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "base/trace_event/trace_event.h" 8 #include "base/trace_event/trace_event.h"
9 #include "cc/base/math_util.h" 9 #include "cc/base/math_util.h"
10 #include "cc/output/copy_output_request.h" 10 #include "cc/output/copy_output_request.h"
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 scissor_rect_ = scissor_rect; 138 scissor_rect_ = scissor_rect;
139 SetClipRect(scissor_rect); 139 SetClipRect(scissor_rect);
140 } 140 }
141 141
142 void SoftwareRenderer::SetClipRect(const gfx::Rect& rect) { 142 void SoftwareRenderer::SetClipRect(const gfx::Rect& rect) {
143 if (!current_canvas_) 143 if (!current_canvas_)
144 return; 144 return;
145 // Skia applies the current matrix to clip rects so we reset it temporary. 145 // Skia applies the current matrix to clip rects so we reset it temporary.
146 SkMatrix current_matrix = current_canvas_->getTotalMatrix(); 146 SkMatrix current_matrix = current_canvas_->getTotalMatrix();
147 current_canvas_->resetMatrix(); 147 current_canvas_->resetMatrix();
148 current_canvas_->clipRect(gfx::RectToSkRect(rect), SkClipOp::kReplace); 148 // TODO(fmalita) stop using kReplace (see crbug.com/673851)
149 current_canvas_->clipRect(gfx::RectToSkRect(rect),
150 SkClipOp::kReplace_private_internal_do_not_use);
149 current_canvas_->setMatrix(current_matrix); 151 current_canvas_->setMatrix(current_matrix);
150 } 152 }
151 153
152 void SoftwareRenderer::ClearCanvas(SkColor color) { 154 void SoftwareRenderer::ClearCanvas(SkColor color) {
153 if (!current_canvas_) 155 if (!current_canvas_)
154 return; 156 return;
155 current_canvas_->clear(color); 157 current_canvas_->clear(color);
156 } 158 }
157 159
158 void SoftwareRenderer::ClearFramebuffer(DrawingFrame* frame) { 160 void SoftwareRenderer::ClearFramebuffer(DrawingFrame* frame) {
(...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after
712 ApplyImageFilter(filter.get(), quad, backdrop_bitmap, nullptr); 714 ApplyImageFilter(filter.get(), quad, backdrop_bitmap, nullptr);
713 715
714 if (!filter_backdrop_image) 716 if (!filter_backdrop_image)
715 return nullptr; 717 return nullptr;
716 718
717 return filter_backdrop_image->makeShader(content_tile_mode, content_tile_mode, 719 return filter_backdrop_image->makeShader(content_tile_mode, content_tile_mode,
718 &filter_backdrop_transform); 720 &filter_backdrop_transform);
719 } 721 }
720 722
721 } // namespace cc 723 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/playback/display_item_list_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698