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 redraw_rect_covers_full_surface) { |
| 187 } |
| 188 |
| 189 void SoftwareRenderer::ClearFramebuffer(DrawingFrame* frame, |
| 190 bool has_external_stencil_test) { |
186 if (frame->current_render_pass->has_transparent_background) { | 191 if (frame->current_render_pass->has_transparent_background) { |
187 ClearCanvas(SkColorSetARGB(0, 0, 0, 0)); | 192 ClearCanvas(SkColorSetARGB(0, 0, 0, 0)); |
188 } else { | 193 } else { |
189 #ifndef NDEBUG | 194 #ifndef NDEBUG |
190 // On DEBUG builds, opaque render passes are cleared to blue | 195 // On DEBUG builds, opaque render passes are cleared to blue |
191 // to easily see regions that were not drawn on the screen. | 196 // to easily see regions that were not drawn on the screen. |
192 ClearCanvas(SkColorSetARGB(255, 0, 0, 255)); | 197 ClearCanvas(SkColorSetARGB(255, 0, 0, 255)); |
193 #endif | 198 #endif |
194 } | 199 } |
195 } | 200 } |
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
545 EnsureBackbuffer(); | 550 EnsureBackbuffer(); |
546 else | 551 else |
547 DiscardBackbuffer(); | 552 DiscardBackbuffer(); |
548 } | 553 } |
549 | 554 |
550 void SoftwareRenderer::SetDiscardBackBufferWhenNotVisible(bool discard) { | 555 void SoftwareRenderer::SetDiscardBackBufferWhenNotVisible(bool discard) { |
551 // The software renderer always discards the backbuffer when not visible. | 556 // The software renderer always discards the backbuffer when not visible. |
552 } | 557 } |
553 | 558 |
554 } // namespace cc | 559 } // namespace cc |
OLD | NEW |