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

Side by Side Diff: src/images/SkImageRef_ashmem.cpp

Issue 112603003: Reverting r12665 & r12666 (Remove duplicate impl for SkImageInfo flattening) due to Chromium/Blink … (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « src/images/SkImageRef_ashmem.h ('k') | src/lazy/SkCachingPixelRef.h » ('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 2011 Google Inc. 2 * Copyright 2011 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 "SkImageRef_ashmem.h" 8 #include "SkImageRef_ashmem.h"
9 #include "SkImageDecoder.h" 9 #include "SkImageDecoder.h"
10 #include "SkFlattenableBuffers.h" 10 #include "SkFlattenableBuffers.h"
(...skipping 13 matching lines...) Expand all
24 #endif 24 #endif
25 25
26 // ashmem likes lengths on page boundaries 26 // ashmem likes lengths on page boundaries
27 static size_t roundToPageSize(size_t size) { 27 static size_t roundToPageSize(size_t size) {
28 const size_t mask = getpagesize() - 1; 28 const size_t mask = getpagesize() - 1;
29 size_t newsize = (size + mask) & ~mask; 29 size_t newsize = (size + mask) & ~mask;
30 // SkDebugf("---- oldsize %d newsize %d\n", size, newsize); 30 // SkDebugf("---- oldsize %d newsize %d\n", size, newsize);
31 return newsize; 31 return newsize;
32 } 32 }
33 33
34 SkImageRef_ashmem::SkImageRef_ashmem(const SkImageInfo& info, 34 SkImageRef_ashmem::SkImageRef_ashmem(SkStreamRewindable* stream,
35 SkStreamRewindable* stream, 35 SkBitmap::Config config,
36 int sampleSize) 36 int sampleSize)
37 : SkImageRef(info, stream, sampleSize) { 37 : SkImageRef(stream, config, sampleSize) {
38 38
39 fRec.fFD = -1; 39 fRec.fFD = -1;
40 fRec.fAddr = NULL; 40 fRec.fAddr = NULL;
41 fRec.fSize = 0; 41 fRec.fSize = 0;
42 fRec.fPinned = false; 42 fRec.fPinned = false;
43 43
44 fCT = NULL; 44 fCT = NULL;
45 } 45 }
46 46
47 SkImageRef_ashmem::~SkImageRef_ashmem() { 47 SkImageRef_ashmem::~SkImageRef_ashmem() {
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 fRec.fFD = -1; 224 fRec.fFD = -1;
225 fRec.fAddr = NULL; 225 fRec.fAddr = NULL;
226 fRec.fSize = 0; 226 fRec.fSize = 0;
227 fRec.fPinned = false; 227 fRec.fPinned = false;
228 fCT = NULL; 228 fCT = NULL;
229 229
230 SkString uri; 230 SkString uri;
231 buffer.readString(&uri); 231 buffer.readString(&uri);
232 this->setURI(uri); 232 this->setURI(uri);
233 } 233 }
OLDNEW
« no previous file with comments | « src/images/SkImageRef_ashmem.h ('k') | src/lazy/SkCachingPixelRef.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698