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

Side by Side Diff: cc/playback/raster_source_helper.cc

Issue 1314943008: cc: Remove implicit conversions from Rect to RectF in src/cc/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/playback/raster_source_helper.h" 5 #include "cc/playback/raster_source_helper.h"
6 6
7 #include "base/trace_event/trace_event.h" 7 #include "base/trace_event/trace_event.h"
8 #include "cc/debug/debug_colors.h" 8 #include "cc/debug/debug_colors.h"
9 #include "third_party/skia/include/core/SkCanvas.h" 9 #include "third_party/skia/include/core/SkCanvas.h"
10 #include "ui/gfx/geometry/rect_conversions.h" 10 #include "ui/gfx/geometry/rect_conversions.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 canvas_playback_rect - canvas_bitmap_rect.OffsetFromOrigin())); 53 canvas_playback_rect - canvas_bitmap_rect.OffsetFromOrigin()));
54 canvas->drawColor(SK_ColorTRANSPARENT, SkXfermode::kClear_Mode); 54 canvas->drawColor(SK_ColorTRANSPARENT, SkXfermode::kClear_Mode);
55 canvas->restore(); 55 canvas->restore();
56 } 56 }
57 } else { 57 } else {
58 // Even if completely covered, for rasterizations that touch the edge of the 58 // Even if completely covered, for rasterizations that touch the edge of the
59 // layer, we also need to raster the background color underneath the last 59 // layer, we also need to raster the background color underneath the last
60 // texel (since the recording won't cover it) and outside the last texel 60 // texel (since the recording won't cover it) and outside the last texel
61 // (due to linear filtering when using this texture). 61 // (due to linear filtering when using this texture).
62 gfx::Rect content_rect = 62 gfx::Rect content_rect =
63 gfx::ToEnclosingRect(gfx::ScaleRect(source_rect, contents_scale)); 63 gfx::ScaleToEnclosingRect(source_rect, contents_scale);
64 64
65 // The final texel of content may only be partially covered by a 65 // The final texel of content may only be partially covered by a
66 // rasterization; this rect represents the content rect that is fully 66 // rasterization; this rect represents the content rect that is fully
67 // covered by content. 67 // covered by content.
68 gfx::Rect deflated_content_rect = content_rect; 68 gfx::Rect deflated_content_rect = content_rect;
69 deflated_content_rect.Inset(0, 0, 1, 1); 69 deflated_content_rect.Inset(0, 0, 1, 1);
70 deflated_content_rect.Intersect(canvas_playback_rect); 70 deflated_content_rect.Intersect(canvas_playback_rect);
71 if (!deflated_content_rect.Contains(canvas_playback_rect)) { 71 if (!deflated_content_rect.Contains(canvas_playback_rect)) {
72 if (clear_canvas_with_debug_color) { 72 if (clear_canvas_with_debug_color) {
73 // Any non-painted areas outside of the content bounds are left in 73 // Any non-painted areas outside of the content bounds are left in
(...skipping 22 matching lines...) Expand all
96 SkRegion::kReplace_Op); 96 SkRegion::kReplace_Op);
97 canvas->clipRect(gfx::RectToSkRect(deflated_content_rect), 97 canvas->clipRect(gfx::RectToSkRect(deflated_content_rect),
98 SkRegion::kDifference_Op); 98 SkRegion::kDifference_Op);
99 canvas->drawColor(background_color, SkXfermode::kSrc_Mode); 99 canvas->drawColor(background_color, SkXfermode::kSrc_Mode);
100 canvas->restore(); 100 canvas->restore();
101 } 101 }
102 } 102 }
103 } 103 }
104 104
105 } // namespace cc 105 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698