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

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

Issue 1142113002: Remove SK_SUPPORT_LEGACY_PUBLIC_IMAGEINFO_FIELDS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 5 years, 7 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_unittest.cc ('k') | cc/resources/ui_resource_bitmap.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/tile_task_worker_pool.h" 5 #include "cc/raster/tile_task_worker_pool.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 skia::RefPtr<SkCanvas> canvas = skia::SharePtr(surface->getCanvas()); 186 skia::RefPtr<SkCanvas> canvas = skia::SharePtr(surface->getCanvas());
187 raster_source->PlaybackToCanvas(canvas.get(), rect, scale); 187 raster_source->PlaybackToCanvas(canvas.get(), rect, scale);
188 return; 188 return;
189 } 189 }
190 190
191 skia::RefPtr<SkSurface> surface = 191 skia::RefPtr<SkSurface> surface =
192 skia::AdoptRef(SkSurface::NewRaster(info, &surface_props)); 192 skia::AdoptRef(SkSurface::NewRaster(info, &surface_props));
193 skia::RefPtr<SkCanvas> canvas = skia::SharePtr(surface->getCanvas()); 193 skia::RefPtr<SkCanvas> canvas = skia::SharePtr(surface->getCanvas());
194 raster_source->PlaybackToCanvas(canvas.get(), rect, scale); 194 raster_source->PlaybackToCanvas(canvas.get(), rect, scale);
195 195
196 SkImageInfo dst_info = info; 196 SkImageInfo dst_info =
197 dst_info.fColorType = buffer_color_type; 197 SkImageInfo::Make(info.width(), info.height(), buffer_color_type,
198 info.alphaType(), info.profileType());
198 // TODO(kaanb): The GL pipeline assumes a 4-byte alignment for the 199 // TODO(kaanb): The GL pipeline assumes a 4-byte alignment for the
199 // bitmap data. There will be no need to call SkAlign4 once crbug.com/293728 200 // bitmap data. There will be no need to call SkAlign4 once crbug.com/293728
200 // is fixed. 201 // is fixed.
201 const size_t dst_row_bytes = SkAlign4(dst_info.minRowBytes()); 202 const size_t dst_row_bytes = SkAlign4(dst_info.minRowBytes());
202 DCHECK_EQ(0u, dst_row_bytes % 4); 203 DCHECK_EQ(0u, dst_row_bytes % 4);
203 bool success = canvas->readPixels(dst_info, memory, dst_row_bytes, 0, 0); 204 bool success = canvas->readPixels(dst_info, memory, dst_row_bytes, 0, 0);
204 DCHECK_EQ(true, success); 205 DCHECK_EQ(true, success);
205 } 206 }
206 207
207 } // namespace cc 208 } // namespace cc
OLDNEW
« no previous file with comments | « cc/output/software_renderer_unittest.cc ('k') | cc/resources/ui_resource_bitmap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698