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

Side by Side Diff: include/core/SkBitmap.h

Issue 17381008: More general version of image filtering; reworked to be robust and easier to SSE (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: make temp. scale function private; disable GM and bench for that function Created 7 years, 5 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
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2006 The Android Open Source Project 3 * Copyright 2006 The Android Open Source Project
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 #ifndef SkBitmap_DEFINED 10 #ifndef SkBitmap_DEFINED
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 * the cpu, then so will the dst. If the src pixels are allocated on the 531 * the cpu, then so will the dst. If the src pixels are allocated on the
532 * gpu (typically as a texture), the it will do the same for the dst. 532 * gpu (typically as a texture), the it will do the same for the dst.
533 * If the request cannot be fulfilled, returns false and dst is unmodified. 533 * If the request cannot be fulfilled, returns false and dst is unmodified.
534 */ 534 */
535 bool deepCopyTo(SkBitmap* dst, Config c) const; 535 bool deepCopyTo(SkBitmap* dst, Config c) const;
536 536
537 /** Returns true if this bitmap can be deep copied into the requested config 537 /** Returns true if this bitmap can be deep copied into the requested config
538 by calling copyTo(). 538 by calling copyTo().
539 */ 539 */
540 bool canCopyTo(Config newConfig) const; 540 bool canCopyTo(Config newConfig) const;
541 541
542 /** 542 /**
543 * DEPRECATED -- will be replaced with API on SkPaint 543 * DEPRECATED -- will be replaced with API on SkPaint
544 */ 544 */
545 void buildMipMap(bool forceRebuild = false); 545 void buildMipMap(bool forceRebuild = false);
546 546
547 #ifdef SK_BUILD_FOR_ANDROID 547 #ifdef SK_BUILD_FOR_ANDROID
548 bool hasHardwareMipMap() const { 548 bool hasHardwareMipMap() const {
549 return (fFlags & kHasHardwareMipMap_Flag) != 0; 549 return (fFlags & kHasHardwareMipMap_Flag) != 0;
550 } 550 }
551 551
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
695 695
696 static SkFixed ComputeMipLevel(SkFixed sx, SkFixed dy); 696 static SkFixed ComputeMipLevel(SkFixed sx, SkFixed dy);
697 697
698 /** Given scale factors sx, sy, determine the miplevel available in the 698 /** Given scale factors sx, sy, determine the miplevel available in the
699 bitmap, and return it (this is the amount to shift matrix iterators 699 bitmap, and return it (this is the amount to shift matrix iterators
700 by). If dst is not null, it is set to the correct level. 700 by). If dst is not null, it is set to the correct level.
701 */ 701 */
702 int extractMipLevel(SkBitmap* dst, SkFixed sx, SkFixed sy); 702 int extractMipLevel(SkBitmap* dst, SkFixed sx, SkFixed sy);
703 bool hasMipMap() const; 703 bool hasMipMap() const;
704 void freeMipMap(); 704 void freeMipMap();
705
706 /** Make a scaled copy of this bitmap into the provided destination.
707 * The caller is responsible for having set the width and height of the
708 * provided destination bitmap, and also having allocated its pixel memory.
709 *
710 * This function is temporary and for testing purposes only; it will likely
711 * move once it has been properly plumbed into the bitmap shader infrastruc ture.
reed1 2013/07/09 17:26:29 this is an 80-col file
humper 2013/07/09 17:46:13 Done.
712 */
713
714 void scale(SkBitmap *dst) const;
humper 2013/07/09 17:21:18 Made private; disabled the GM and bench.
705 715
706 friend struct SkBitmapProcState; 716 friend struct SkBitmapProcState;
707 }; 717 };
708 718
709 class SkAutoLockPixels : public SkNoncopyable { 719 class SkAutoLockPixels : public SkNoncopyable {
710 public: 720 public:
711 SkAutoLockPixels(const SkBitmap& bm, bool doLock = true) : fBitmap(bm) { 721 SkAutoLockPixels(const SkBitmap& bm, bool doLock = true) : fBitmap(bm) {
712 fDidLock = doLock; 722 fDidLock = doLock;
713 if (doLock) { 723 if (doLock) {
714 bm.lockPixels(); 724 bm.lockPixels();
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
811 821
812 // returns the address of the byte that contains the x coordinate 822 // returns the address of the byte that contains the x coordinate
813 inline uint8_t* SkBitmap::getAddr1(int x, int y) const { 823 inline uint8_t* SkBitmap::getAddr1(int x, int y) const {
814 SkASSERT(fPixels); 824 SkASSERT(fPixels);
815 SkASSERT(fConfig == kA1_Config); 825 SkASSERT(fConfig == kA1_Config);
816 SkASSERT((unsigned)x < fWidth && (unsigned)y < fHeight); 826 SkASSERT((unsigned)x < fWidth && (unsigned)y < fHeight);
817 return (uint8_t*)fPixels + y * fRowBytes + (x >> 3); 827 return (uint8_t*)fPixels + y * fRowBytes + (x >> 3);
818 } 828 }
819 829
820 #endif 830 #endif
OLDNEW
« no previous file with comments | « gyp/opts.gyp ('k') | include/core/SkPaint.h » ('j') | include/core/SkPaint.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698