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

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

Issue 24239006: cc: Don't discard framebuffer when using partial swaps (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix test Created 7 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « cc/output/software_renderer.h ('k') | no next file » | 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/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
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
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
OLDNEW
« no previous file with comments | « cc/output/software_renderer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698