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

Side by Side Diff: src/image/SkReadPixelsRec.h

Issue 793723002: add readPixels to SkImage (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: use better name on test Created 6 years 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/image/SkImage_Raster.cpp ('k') | src/image/SkSurface.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright 2014 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8 #ifndef SkReadPixelsRec_DEFINED
9 #define SkReadPixelsRec_DEFINED
10
11 #include "SkImageInfo.h"
12
13 /**
14 * Helper class to package and trim the parameters passed to readPixels()
15 */
16 struct SkReadPixelsRec {
17 SkReadPixelsRec(const SkImageInfo& info, void* pixels, size_t rowBytes, int x, int y)
18 : fPixels(pixels)
19 , fRowBytes(rowBytes)
20 , fInfo(info)
21 , fX(x)
22 , fY(y)
23 {}
24
25 void* fPixels;
26 size_t fRowBytes;
27 SkImageInfo fInfo;
28 int fX;
29 int fY;
30
31 /*
32 * On true, may have modified its fields (except fRowBytes) to make it a le gal subset
33 * of the specified src width/height.
34 *
35 * On false, leaves self unchanged, but indicates that it does not overlap src, or
36 * is not valid (e.g. bad fInfo) for readPixels().
37 */
38 bool trim(int srcWidth, int srcHeight);
39 };
40
41 #endif
OLDNEW
« no previous file with comments | « src/image/SkImage_Raster.cpp ('k') | src/image/SkSurface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698