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

Side by Side Diff: src/gpu/SkGrPixelRef.cpp

Issue 143073008: add installPixels (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: rebase Created 6 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « src/gpu/GrSurface.cpp ('k') | src/images/SkMovie_gif.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 2010 Google Inc. 3 * Copyright 2010 Google Inc.
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 10
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 left = subset->fLeft; 171 left = subset->fLeft;
172 width = subset->width(); 172 width = subset->width();
173 top = subset->fTop; 173 top = subset->fTop;
174 height = subset->height(); 174 height = subset->height();
175 } else { 175 } else {
176 left = 0; 176 left = 0;
177 width = fSurface->width(); 177 width = fSurface->width();
178 top = 0; 178 top = 0;
179 height = fSurface->height(); 179 height = fSurface->height();
180 } 180 }
181 dst->setConfig(SkBitmap::kARGB_8888_Config, width, height); 181 if (!dst->allocPixels(SkImageInfo::MakeN32Premul(width, height))) {
182 if (!dst->allocPixels()) {
183 SkDebugf("SkGrPixelRef::onReadPixels failed to alloc bitmap for result!\ n"); 182 SkDebugf("SkGrPixelRef::onReadPixels failed to alloc bitmap for result!\ n");
184 return false; 183 return false;
185 } 184 }
186 SkAutoLockPixels al(*dst); 185 SkAutoLockPixels al(*dst);
187 void* buffer = dst->getPixels(); 186 void* buffer = dst->getPixels();
188 return fSurface->readPixels(left, top, width, height, 187 return fSurface->readPixels(left, top, width, height,
189 kSkia8888_GrPixelConfig, 188 kSkia8888_GrPixelConfig,
190 buffer, dst->rowBytes()); 189 buffer, dst->rowBytes());
191 } 190 }
OLDNEW
« no previous file with comments | « src/gpu/GrSurface.cpp ('k') | src/images/SkMovie_gif.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698