OLD | NEW |
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/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
8 #include "cc/base/math_util.h" | 8 #include "cc/base/math_util.h" |
9 #include "cc/output/compositor_frame.h" | 9 #include "cc/output/compositor_frame.h" |
10 #include "cc/output/compositor_frame_ack.h" | 10 #include "cc/output/compositor_frame_ack.h" |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 | 175 |
176 void SoftwareRenderer::ClearCanvas(SkColor color) { | 176 void SoftwareRenderer::ClearCanvas(SkColor color) { |
177 // SkCanvas::clear doesn't respect the current clipping region | 177 // SkCanvas::clear doesn't respect the current clipping region |
178 // so we SkCanvas::drawColor instead if scissoring is active. | 178 // so we SkCanvas::drawColor instead if scissoring is active. |
179 if (is_scissor_enabled_) | 179 if (is_scissor_enabled_) |
180 current_canvas_->drawColor(color, SkXfermode::kSrc_Mode); | 180 current_canvas_->drawColor(color, SkXfermode::kSrc_Mode); |
181 else | 181 else |
182 current_canvas_->clear(color); | 182 current_canvas_->clear(color); |
183 } | 183 } |
184 | 184 |
185 void SoftwareRenderer::ClearFramebuffer(DrawingFrame* frame) { | 185 void SoftwareRenderer::DiscardPixels(bool has_external_stencil_test, |
| 186 bool draw_rect_covers_full_surface) {} |
| 187 |
| 188 void SoftwareRenderer::ClearFramebuffer(DrawingFrame* frame, |
| 189 bool has_external_stencil_test) { |
186 if (frame->current_render_pass->has_transparent_background) { | 190 if (frame->current_render_pass->has_transparent_background) { |
187 ClearCanvas(SkColorSetARGB(0, 0, 0, 0)); | 191 ClearCanvas(SkColorSetARGB(0, 0, 0, 0)); |
188 } else { | 192 } else { |
189 #ifndef NDEBUG | 193 #ifndef NDEBUG |
190 // On DEBUG builds, opaque render passes are cleared to blue | 194 // On DEBUG builds, opaque render passes are cleared to blue |
191 // to easily see regions that were not drawn on the screen. | 195 // to easily see regions that were not drawn on the screen. |
192 ClearCanvas(SkColorSetARGB(255, 0, 0, 255)); | 196 ClearCanvas(SkColorSetARGB(255, 0, 0, 255)); |
193 #endif | 197 #endif |
194 } | 198 } |
195 } | 199 } |
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
545 EnsureBackbuffer(); | 549 EnsureBackbuffer(); |
546 else | 550 else |
547 DiscardBackbuffer(); | 551 DiscardBackbuffer(); |
548 } | 552 } |
549 | 553 |
550 void SoftwareRenderer::SetDiscardBackBufferWhenNotVisible(bool discard) { | 554 void SoftwareRenderer::SetDiscardBackBufferWhenNotVisible(bool discard) { |
551 // The software renderer always discards the backbuffer when not visible. | 555 // The software renderer always discards the backbuffer when not visible. |
552 } | 556 } |
553 | 557 |
554 } // namespace cc | 558 } // namespace cc |
OLD | NEW |