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

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

Issue 2575533002: SkClipOp is an enum class now (Closed)
Patch Set: 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 | « ash/common/system/tray/tray_details_view.cc ('k') | 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), kReplace_SkClipOp); 148 current_canvas_->clipRect(gfx::RectToSkRect(rect), SkClipOp::kReplace);
149 current_canvas_->setMatrix(current_matrix); 149 current_canvas_->setMatrix(current_matrix);
150 } 150 }
151 151
152 void SoftwareRenderer::ClearCanvas(SkColor color) { 152 void SoftwareRenderer::ClearCanvas(SkColor color) {
153 if (!current_canvas_) 153 if (!current_canvas_)
154 return; 154 return;
155 current_canvas_->clear(color); 155 current_canvas_->clear(color);
156 } 156 }
157 157
158 void SoftwareRenderer::ClearFramebuffer(DrawingFrame* frame) { 158 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); 712 ApplyImageFilter(filter.get(), quad, backdrop_bitmap, nullptr);
713 713
714 if (!filter_backdrop_image) 714 if (!filter_backdrop_image)
715 return nullptr; 715 return nullptr;
716 716
717 return filter_backdrop_image->makeShader(content_tile_mode, content_tile_mode, 717 return filter_backdrop_image->makeShader(content_tile_mode, content_tile_mode,
718 &filter_backdrop_transform); 718 &filter_backdrop_transform);
719 } 719 }
720 720
721 } // namespace cc 721 } // namespace cc
OLDNEW
« no previous file with comments | « ash/common/system/tray/tray_details_view.cc ('k') | cc/playback/display_item_list_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698