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

Side by Side Diff: cc/raster/raster_buffer_provider.cc

Issue 2332143002: cc: Populate SkColorSpace for raster from resource gfx::ColorSpace (Closed)
Patch Set: Review feedback Created 4 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
« no previous file with comments | « cc/raster/raster_buffer_provider.h ('k') | cc/raster/zero_copy_raster_buffer_provider.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 // static 45 // static
46 void RasterBufferProvider::PlaybackToMemory( 46 void RasterBufferProvider::PlaybackToMemory(
47 void* memory, 47 void* memory,
48 ResourceFormat format, 48 ResourceFormat format,
49 const gfx::Size& size, 49 const gfx::Size& size,
50 size_t stride, 50 size_t stride,
51 const RasterSource* raster_source, 51 const RasterSource* raster_source,
52 const gfx::Rect& canvas_bitmap_rect, 52 const gfx::Rect& canvas_bitmap_rect,
53 const gfx::Rect& canvas_playback_rect, 53 const gfx::Rect& canvas_playback_rect,
54 float scale, 54 float scale,
55 sk_sp<SkColorSpace> dst_color_space,
55 const RasterSource::PlaybackSettings& playback_settings) { 56 const RasterSource::PlaybackSettings& playback_settings) {
56 TRACE_EVENT0("disabled-by-default-cc.debug", 57 TRACE_EVENT0("disabled-by-default-cc.debug",
57 "RasterBufferProvider::PlaybackToMemory"); 58 "RasterBufferProvider::PlaybackToMemory");
58 59
59 DCHECK(IsSupportedPlaybackToMemoryFormat(format)) << format; 60 DCHECK(IsSupportedPlaybackToMemoryFormat(format)) << format;
60 61
61 // 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.
62 SkImageInfo info = 63 SkImageInfo info = SkImageInfo::MakeN32(size.width(), size.height(),
63 SkImageInfo::MakeN32(size.width(), size.height(), kPremul_SkAlphaType); 64 kPremul_SkAlphaType, dst_color_space);
64 65
65 // Use unknown pixel geometry to disable LCD text. 66 // Use unknown pixel geometry to disable LCD text.
66 SkSurfaceProps surface_props(0, kUnknown_SkPixelGeometry); 67 SkSurfaceProps surface_props(0, kUnknown_SkPixelGeometry);
67 if (raster_source->CanUseLCDText()) { 68 if (raster_source->CanUseLCDText()) {
68 // 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.
69 surface_props = SkSurfaceProps(SkSurfaceProps::kLegacyFontHost_InitType); 70 surface_props = SkSurfaceProps(SkSurfaceProps::kLegacyFontHost_InitType);
70 } 71 }
71 72
72 if (!stride) 73 if (!stride)
73 stride = info.minRowBytes(); 74 stride = info.minRowBytes();
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 case RGB_565: 143 case RGB_565:
143 case RED_8: 144 case RED_8:
144 case LUMINANCE_F16: 145 case LUMINANCE_F16:
145 return false; 146 return false;
146 } 147 }
147 NOTREACHED(); 148 NOTREACHED();
148 return false; 149 return false;
149 } 150 }
150 151
151 } // namespace cc 152 } // namespace cc
OLDNEW
« no previous file with comments | « cc/raster/raster_buffer_provider.h ('k') | cc/raster/zero_copy_raster_buffer_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698