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

Side by Side Diff: src/codec/SkAndroidCodec.cpp

Issue 1411693005: Make AndroidOptions const (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 1 month 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 | « include/codec/SkAndroidCodec.h ('k') | src/codec/SkSampledCodec.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 2015 Google Inc. 2 * Copyright 2015 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 "SkAndroidCodec.h" 8 #include "SkAndroidCodec.h"
9 #include "SkCodec.h" 9 #include "SkCodec.h"
10 #include "SkCodecPriv.h" 10 #include "SkCodecPriv.h"
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 return this->getSampledDimensions(sampleSize); 87 return this->getSampledDimensions(sampleSize);
88 } 88 }
89 89
90 // This should perhaps call a virtual function, but currently both of our su bclasses 90 // This should perhaps call a virtual function, but currently both of our su bclasses
91 // want the same implementation. 91 // want the same implementation.
92 return SkISize::Make(get_scaled_dimension(subset.width(), sampleSize), 92 return SkISize::Make(get_scaled_dimension(subset.width(), sampleSize),
93 get_scaled_dimension(subset.height(), sampleSize)); 93 get_scaled_dimension(subset.height(), sampleSize));
94 } 94 }
95 95
96 SkCodec::Result SkAndroidCodec::getAndroidPixels(const SkImageInfo& info, void* pixels, 96 SkCodec::Result SkAndroidCodec::getAndroidPixels(const SkImageInfo& info, void* pixels,
97 size_t rowBytes, AndroidOptions* options) { 97 size_t rowBytes, const AndroidOptions* options) {
98 if (!pixels) { 98 if (!pixels) {
99 return SkCodec::kInvalidParameters; 99 return SkCodec::kInvalidParameters;
100 } 100 }
101 if (rowBytes < info.minRowBytes()) { 101 if (rowBytes < info.minRowBytes()) {
102 return SkCodec::kInvalidParameters; 102 return SkCodec::kInvalidParameters;
103 } 103 }
104 104
105 AndroidOptions defaultOptions; 105 AndroidOptions defaultOptions;
106 if (!options) { 106 if (!options) {
107 options = &defaultOptions; 107 options = &defaultOptions;
(...skipping 12 matching lines...) Expand all
120 } 120 }
121 } 121 }
122 122
123 return this->onGetAndroidPixels(info, pixels, rowBytes, *options); 123 return this->onGetAndroidPixels(info, pixels, rowBytes, *options);
124 } 124 }
125 125
126 SkCodec::Result SkAndroidCodec::getAndroidPixels(const SkImageInfo& info, void* pixels, 126 SkCodec::Result SkAndroidCodec::getAndroidPixels(const SkImageInfo& info, void* pixels,
127 size_t rowBytes) { 127 size_t rowBytes) {
128 return this->getAndroidPixels(info, pixels, rowBytes, nullptr); 128 return this->getAndroidPixels(info, pixels, rowBytes, nullptr);
129 } 129 }
OLDNEW
« no previous file with comments | « include/codec/SkAndroidCodec.h ('k') | src/codec/SkSampledCodec.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698