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

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

Issue 1643373002: Use proper row step in SkRawCodec (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 10 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 | « no previous file | no next file » | 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 2016 Google Inc. 2 * Copyright 2016 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 "SkCodec.h" 8 #include "SkCodec.h"
9 #include "SkCodecPriv.h" 9 #include "SkCodecPriv.h"
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after
501 SkAutoTMalloc<uint8_t> srcRow(width * 3); 501 SkAutoTMalloc<uint8_t> srcRow(width * 3);
502 502
503 dng_pixel_buffer buffer; 503 dng_pixel_buffer buffer;
504 buffer.fData = &srcRow[0]; 504 buffer.fData = &srcRow[0];
505 buffer.fPlane = 0; 505 buffer.fPlane = 0;
506 buffer.fPlanes = 3; 506 buffer.fPlanes = 3;
507 buffer.fColStep = buffer.fPlanes; 507 buffer.fColStep = buffer.fPlanes;
508 buffer.fPlaneStep = 1; 508 buffer.fPlaneStep = 1;
509 buffer.fPixelType = ttByte; 509 buffer.fPixelType = ttByte;
510 buffer.fPixelSize = sizeof(uint8_t); 510 buffer.fPixelSize = sizeof(uint8_t);
511 buffer.fRowStep = sizeof(srcRow); 511 buffer.fRowStep = width * 3;
512 512
513 for (int i = 0; i < height; ++i) { 513 for (int i = 0; i < height; ++i) {
514 buffer.fArea = dng_rect(i, 0, i + 1, width); 514 buffer.fArea = dng_rect(i, 0, i + 1, width);
515 515
516 try { 516 try {
517 image->Get(buffer, dng_image::edge_zero); 517 image->Get(buffer, dng_image::edge_zero);
518 } catch (...) { 518 } catch (...) {
519 *rowsDecoded = i; 519 *rowsDecoded = i;
520 return kIncompleteInput; 520 return kIncompleteInput;
521 } 521 }
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
559 SkISize sizeFloor = this->onGetScaledDimensions(1.f / std::floor(fullShortEd ge / shortEdge)); 559 SkISize sizeFloor = this->onGetScaledDimensions(1.f / std::floor(fullShortEd ge / shortEdge));
560 SkISize sizeCeil = this->onGetScaledDimensions(1.f / std::ceil(fullShortEdge / shortEdge)); 560 SkISize sizeCeil = this->onGetScaledDimensions(1.f / std::ceil(fullShortEdge / shortEdge));
561 return sizeFloor == dim || sizeCeil == dim; 561 return sizeFloor == dim || sizeCeil == dim;
562 } 562 }
563 563
564 SkRawCodec::~SkRawCodec() {} 564 SkRawCodec::~SkRawCodec() {}
565 565
566 SkRawCodec::SkRawCodec(SkDngImage* dngImage) 566 SkRawCodec::SkRawCodec(SkDngImage* dngImage)
567 : INHERITED(dngImage->getImageInfo(), nullptr) 567 : INHERITED(dngImage->getImageInfo(), nullptr)
568 , fDngImage(dngImage) {} 568 , fDngImage(dngImage) {}
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698