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

Side by Side Diff: src/core/SkCanvas.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/core/SkBitmap.cpp ('k') | src/effects/SkBlurMaskFilter.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 /* 2 /*
3 * Copyright 2008 The Android Open Source Project 3 * Copyright 2008 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 1096 matching lines...) Expand 10 before | Expand all | Expand 10 after
1107 return; // failure, fAddr is NULL 1107 return; // failure, fAddr is NULL
1108 } 1108 }
1109 fAddr = fBitmap.getPixels(); 1109 fAddr = fBitmap.getPixels();
1110 fRowBytes = fBitmap.rowBytes(); 1110 fRowBytes = fBitmap.rowBytes();
1111 } 1111 }
1112 SkASSERT(fAddr); // success 1112 SkASSERT(fAddr); // success
1113 } 1113 }
1114 1114
1115 bool SkAutoROCanvasPixels::asROBitmap(SkBitmap* bitmap) const { 1115 bool SkAutoROCanvasPixels::asROBitmap(SkBitmap* bitmap) const {
1116 if (fAddr) { 1116 if (fAddr) {
1117 return bitmap->installPixels(fInfo, const_cast<void*>(fAddr), fRowBytes, 1117 return bitmap->installPixels(fInfo, const_cast<void*>(fAddr), fRowBytes) ;
1118 NULL, NULL);
1119 } else { 1118 } else {
1120 bitmap->reset(); 1119 bitmap->reset();
1121 return false; 1120 return false;
1122 } 1121 }
1123 } 1122 }
1124 1123
1125 void SkCanvas::onPushCull(const SkRect& cullRect) { 1124 void SkCanvas::onPushCull(const SkRect& cullRect) {
1126 // do nothing. Subclasses may do something 1125 // do nothing. Subclasses may do something
1127 } 1126 }
1128 1127
(...skipping 1498 matching lines...) Expand 10 before | Expand all | Expand 10 after
2627 if (!supported_for_raster_canvas(info)) { 2626 if (!supported_for_raster_canvas(info)) {
2628 return NULL; 2627 return NULL;
2629 } 2628 }
2630 2629
2631 SkBitmap bitmap; 2630 SkBitmap bitmap;
2632 if (!bitmap.installPixels(info, pixels, rowBytes)) { 2631 if (!bitmap.installPixels(info, pixels, rowBytes)) {
2633 return NULL; 2632 return NULL;
2634 } 2633 }
2635 return SkNEW_ARGS(SkCanvas, (bitmap)); 2634 return SkNEW_ARGS(SkCanvas, (bitmap));
2636 } 2635 }
OLDNEW
« no previous file with comments | « src/core/SkBitmap.cpp ('k') | src/effects/SkBlurMaskFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698