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

Side by Side Diff: src/utils/SkCanvasStateUtils.cpp

Issue 300263005: Revert "Revert of add colortable support to imagegenerator (https://codereview.chromium.org/3044430… (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 6 years, 6 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 | « src/lazy/SkDiscardablePixelRef.cpp ('k') | tests/AAClipTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2013 Google Inc. 2 * Copyright 2013 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkCanvasStateUtils.h" 8 #include "SkCanvasStateUtils.h"
9 9
10 #include "SkBitmapDevice.h" 10 #include "SkBitmapDevice.h"
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 layerState.raster.config == kARGB_8888_RasterConfig ? kN32_SkColorType : 284 layerState.raster.config == kARGB_8888_RasterConfig ? kN32_SkColorType :
285 layerState.raster.config == kRGB_565_RasterConfig ? kRGB_565_SkColorType : 285 layerState.raster.config == kRGB_565_RasterConfig ? kRGB_565_SkColorType :
286 kUnknown_SkColorType; 286 kUnknown_SkColorType;
287 287
288 if (colorType == kUnknown_SkColorType) { 288 if (colorType == kUnknown_SkColorType) {
289 return NULL; 289 return NULL;
290 } 290 }
291 291
292 bitmap.installPixels(SkImageInfo::Make(layerState.width, layerState.height, 292 bitmap.installPixels(SkImageInfo::Make(layerState.width, layerState.height,
293 colorType, kPremul_SkAlphaType), 293 colorType, kPremul_SkAlphaType),
294 layerState.raster.pixels, layerState.raster.rowBytes, 294 layerState.raster.pixels, layerState.raster.rowBytes);
295 NULL, NULL);
296 295
297 SkASSERT(!bitmap.empty()); 296 SkASSERT(!bitmap.empty());
298 SkASSERT(!bitmap.isNull()); 297 SkASSERT(!bitmap.isNull());
299 298
300 SkAutoTUnref<SkCanvas> canvas(SkNEW_ARGS(SkCanvas, (bitmap))); 299 SkAutoTUnref<SkCanvas> canvas(SkNEW_ARGS(SkCanvas, (bitmap)));
301 300
302 // setup the matrix and clip 301 // setup the matrix and clip
303 setup_canvas_from_MC_state(layerState.mcState, canvas.get()); 302 setup_canvas_from_MC_state(layerState.mcState, canvas.get());
304 303
305 return canvas.detach(); 304 return canvas.detach();
(...skipping 28 matching lines...) Expand all
334 } 333 }
335 334
336 return canvas.detach(); 335 return canvas.detach();
337 } 336 }
338 337
339 //////////////////////////////////////////////////////////////////////////////// 338 ////////////////////////////////////////////////////////////////////////////////
340 339
341 void SkCanvasStateUtils::ReleaseCanvasState(SkCanvasState* state) { 340 void SkCanvasStateUtils::ReleaseCanvasState(SkCanvasState* state) {
342 SkDELETE(state); 341 SkDELETE(state);
343 } 342 }
OLDNEW
« no previous file with comments | « src/lazy/SkDiscardablePixelRef.cpp ('k') | tests/AAClipTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698