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

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

Issue 2179003003: cc: disable denorm handling before calling into Skia's filter code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Protect orig_state_ member var with #ifdef __SSE__. Created 4 years, 4 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
« no previous file with comments | « cc/output/software_renderer.cc ('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 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.h" 5 #include "cc/playback/raster_source.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/trace_event/trace_event.h" 9 #include "base/trace_event/trace_event.h"
10 #include "cc/base/math_util.h"
10 #include "cc/base/region.h" 11 #include "cc/base/region.h"
11 #include "cc/debug/debug_colors.h" 12 #include "cc/debug/debug_colors.h"
12 #include "cc/playback/display_item_list.h" 13 #include "cc/playback/display_item_list.h"
13 #include "cc/playback/image_hijack_canvas.h" 14 #include "cc/playback/image_hijack_canvas.h"
14 #include "cc/playback/skip_image_canvas.h" 15 #include "cc/playback/skip_image_canvas.h"
15 #include "skia/ext/analysis_canvas.h" 16 #include "skia/ext/analysis_canvas.h"
16 #include "third_party/skia/include/core/SkCanvas.h" 17 #include "third_party/skia/include/core/SkCanvas.h"
17 #include "third_party/skia/include/core/SkClipStack.h" 18 #include "third_party/skia/include/core/SkClipStack.h"
18 #include "third_party/skia/include/core/SkPictureRecorder.h" 19 #include "third_party/skia/include/core/SkPictureRecorder.h"
19 #include "ui/gfx/geometry/rect_conversions.h" 20 #include "ui/gfx/geometry/rect_conversions.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 67
67 void RasterSource::PlaybackToCanvas(SkCanvas* raster_canvas, 68 void RasterSource::PlaybackToCanvas(SkCanvas* raster_canvas,
68 const gfx::Rect& canvas_bitmap_rect, 69 const gfx::Rect& canvas_bitmap_rect,
69 const gfx::Rect& canvas_playback_rect, 70 const gfx::Rect& canvas_playback_rect,
70 float contents_scale, 71 float contents_scale,
71 const PlaybackSettings& settings) const { 72 const PlaybackSettings& settings) const {
72 SkIRect raster_bounds = gfx::RectToSkIRect(canvas_bitmap_rect); 73 SkIRect raster_bounds = gfx::RectToSkIRect(canvas_bitmap_rect);
73 if (!canvas_playback_rect.IsEmpty() && 74 if (!canvas_playback_rect.IsEmpty() &&
74 !raster_bounds.intersect(gfx::RectToSkIRect(canvas_playback_rect))) 75 !raster_bounds.intersect(gfx::RectToSkIRect(canvas_playback_rect)))
75 return; 76 return;
77 // Treat all subnormal values as zero for performance.
78 ScopedSubnormalFloatDisabler disabler;
76 79
77 raster_canvas->save(); 80 raster_canvas->save();
78 raster_canvas->translate(-canvas_bitmap_rect.x(), -canvas_bitmap_rect.y()); 81 raster_canvas->translate(-canvas_bitmap_rect.x(), -canvas_bitmap_rect.y());
79 raster_canvas->clipRect(SkRect::MakeFromIRect(raster_bounds)); 82 raster_canvas->clipRect(SkRect::MakeFromIRect(raster_bounds));
80 raster_canvas->scale(contents_scale, contents_scale); 83 raster_canvas->scale(contents_scale, contents_scale);
81 PlaybackToCanvas(raster_canvas, settings); 84 PlaybackToCanvas(raster_canvas, settings);
82 raster_canvas->restore(); 85 raster_canvas->restore();
83 } 86 }
84 87
85 void RasterSource::PlaybackToCanvas(SkCanvas* raster_canvas, 88 void RasterSource::PlaybackToCanvas(SkCanvas* raster_canvas,
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 bool can_use_lcd_text = false; 298 bool can_use_lcd_text = false;
296 return scoped_refptr<RasterSource>(new RasterSource(this, can_use_lcd_text)); 299 return scoped_refptr<RasterSource>(new RasterSource(this, can_use_lcd_text));
297 } 300 }
298 301
299 RasterSource::PlaybackSettings::PlaybackSettings() 302 RasterSource::PlaybackSettings::PlaybackSettings()
300 : playback_to_shared_canvas(false), 303 : playback_to_shared_canvas(false),
301 skip_images(false), 304 skip_images(false),
302 use_image_hijack_canvas(true) {} 305 use_image_hijack_canvas(true) {}
303 306
304 } // namespace cc 307 } // namespace cc
OLDNEW
« no previous file with comments | « cc/output/software_renderer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698