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/raster/raster_buffer_provider.cc

Issue 2752523006: cc: Use SkCreateColorSpaceXformCanvas for color transforms (Closed)
Patch Set: Allow to link Created 3 years, 9 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/raster/raster_buffer_provider.h" 5 #include "cc/raster/raster_buffer_provider.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/playback/raster_source.h" 10 #include "cc/playback/raster_source.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 // static 46 // static
47 void RasterBufferProvider::PlaybackToMemory( 47 void RasterBufferProvider::PlaybackToMemory(
48 void* memory, 48 void* memory,
49 ResourceFormat format, 49 ResourceFormat format,
50 const gfx::Size& size, 50 const gfx::Size& size,
51 size_t stride, 51 size_t stride,
52 const RasterSource* raster_source, 52 const RasterSource* raster_source,
53 const gfx::Rect& canvas_bitmap_rect, 53 const gfx::Rect& canvas_bitmap_rect,
54 const gfx::Rect& canvas_playback_rect, 54 const gfx::Rect& canvas_playback_rect,
55 float scale, 55 float scale,
56 sk_sp<SkColorSpace> dst_color_space,
57 const RasterSource::PlaybackSettings& playback_settings) { 56 const RasterSource::PlaybackSettings& playback_settings) {
58 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("cc.debug"), 57 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("cc.debug"),
59 "RasterBufferProvider::PlaybackToMemory"); 58 "RasterBufferProvider::PlaybackToMemory");
60 59
61 DCHECK(IsSupportedPlaybackToMemoryFormat(format)) << format; 60 DCHECK(IsSupportedPlaybackToMemoryFormat(format)) << format;
62 61
63 // Uses kPremul_SkAlphaType since the result is not known to be opaque. 62 // Uses kPremul_SkAlphaType since the result is not known to be opaque.
64 SkImageInfo info = SkImageInfo::MakeN32(size.width(), size.height(), 63 SkImageInfo info =
65 kPremul_SkAlphaType, dst_color_space); 64 SkImageInfo::MakeN32(size.width(), size.height(), kPremul_SkAlphaType);
66 65
67 // Use unknown pixel geometry to disable LCD text. 66 // Use unknown pixel geometry to disable LCD text.
68 SkSurfaceProps surface_props(0, kUnknown_SkPixelGeometry); 67 SkSurfaceProps surface_props(0, kUnknown_SkPixelGeometry);
69 if (raster_source->CanUseLCDText()) { 68 if (raster_source->CanUseLCDText()) {
70 // LegacyFontHost will get LCD text and skia figures out what type to use. 69 // LegacyFontHost will get LCD text and skia figures out what type to use.
71 surface_props = SkSurfaceProps(SkSurfaceProps::kLegacyFontHost_InitType); 70 surface_props = SkSurfaceProps(SkSurfaceProps::kLegacyFontHost_InitType);
72 } 71 }
73 72
74 if (!stride) 73 if (!stride)
75 stride = info.minRowBytes(); 74 stride = info.minRowBytes();
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 case RED_8: 145 case RED_8:
147 case LUMINANCE_F16: 146 case LUMINANCE_F16:
148 case RGBA_F16: 147 case RGBA_F16:
149 return false; 148 return false;
150 } 149 }
151 NOTREACHED(); 150 NOTREACHED();
152 return false; 151 return false;
153 } 152 }
154 153
155 } // namespace cc 154 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698