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 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
465 quad_rect, | 465 quad_rect, |
466 ¤t_paint_); | 466 ¤t_paint_); |
467 } | 467 } |
468 | 468 |
469 if (needs_layer) | 469 if (needs_layer) |
470 current_canvas_->restore(); | 470 current_canvas_->restore(); |
471 } | 471 } |
472 | 472 |
473 void SoftwareRenderer::DrawTileQuad(const DrawingFrame* frame, | 473 void SoftwareRenderer::DrawTileQuad(const DrawingFrame* frame, |
474 const TileDrawQuad* quad) { | 474 const TileDrawQuad* quad) { |
475 DCHECK(!output_surface_->ForcedDrawToSoftwareDevice()); | 475 DCHECK(resource_provider_); |
danakj
2014/07/10 18:33:59
is this adding some value that i don't see? i'd ju
boliu
2014/07/10 18:40:36
This was supposed to check resourceless software d
danakj
2014/07/10 18:43:21
Oh, I see this is NULL in resourceless mode.
| |
476 DCHECK(IsSoftwareResource(quad->resource_id)); | 476 DCHECK(IsSoftwareResource(quad->resource_id)); |
477 | 477 |
478 ResourceProvider::ScopedReadLockSoftware lock(resource_provider_, | 478 ResourceProvider::ScopedReadLockSoftware lock(resource_provider_, |
479 quad->resource_id); | 479 quad->resource_id); |
480 if (!lock.valid()) | 480 if (!lock.valid()) |
481 return; | 481 return; |
482 DCHECK_EQ(GL_CLAMP_TO_EDGE, lock.wrap_mode()); | 482 DCHECK_EQ(GL_CLAMP_TO_EDGE, lock.wrap_mode()); |
483 | 483 |
484 gfx::RectF visible_tex_coord_rect = MathUtil::ScaleRectProportional( | 484 gfx::RectF visible_tex_coord_rect = MathUtil::ScaleRectProportional( |
485 quad->tex_coord_rect, quad->rect, quad->visible_rect); | 485 quad->tex_coord_rect, quad->rect, quad->visible_rect); |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
644 } | 644 } |
645 | 645 |
646 void SoftwareRenderer::DidChangeVisibility() { | 646 void SoftwareRenderer::DidChangeVisibility() { |
647 if (visible()) | 647 if (visible()) |
648 EnsureBackbuffer(); | 648 EnsureBackbuffer(); |
649 else | 649 else |
650 DiscardBackbuffer(); | 650 DiscardBackbuffer(); |
651 } | 651 } |
652 | 652 |
653 } // namespace cc | 653 } // namespace cc |
OLD | NEW |