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

Side by Side Diff: src/image/SkImage.cpp

Issue 19729007: Add SkImage->draw() call with src and dst rects. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: 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
« no previous file with comments | « include/core/SkImage.h ('k') | src/image/SkImagePriv.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 2012 Google Inc. 2 * Copyright 2012 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 "SkBitmap.h" 8 #include "SkBitmap.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkImagePriv.h" 10 #include "SkImagePriv.h"
(...skipping 18 matching lines...) Expand all
29 id = sk_atomic_inc(&gUniqueID) + 1; 29 id = sk_atomic_inc(&gUniqueID) + 1;
30 } while (0 == id); 30 } while (0 == id);
31 return id; 31 return id;
32 } 32 }
33 33
34 void SkImage::draw(SkCanvas* canvas, SkScalar x, SkScalar y, 34 void SkImage::draw(SkCanvas* canvas, SkScalar x, SkScalar y,
35 const SkPaint* paint) { 35 const SkPaint* paint) {
36 as_IB(this)->onDraw(canvas, x, y, paint); 36 as_IB(this)->onDraw(canvas, x, y, paint);
37 } 37 }
38 38
39 void SkImage::draw(SkCanvas* canvas, const SkRect* src, const SkRect& dst,
40 const SkPaint* paint) {
41 as_IB(this)->onDrawRectToRect(canvas, src, dst, paint);
42 }
43
39 GrTexture* SkImage::getTexture() { 44 GrTexture* SkImage::getTexture() {
40 return as_IB(this)->onGetTexture(); 45 return as_IB(this)->onGetTexture();
41 } 46 }
42 47
43 SkData* SkImage::encode(SkImageEncoder::Type type, int quality) const { 48 SkData* SkImage::encode(SkImageEncoder::Type type, int quality) const {
44 SkBitmap bm; 49 SkBitmap bm;
45 if (as_IB(this)->getROPixels(&bm)) { 50 if (as_IB(this)->getROPixels(&bm)) {
46 return SkImageEncoder::EncodeData(bm, type, quality); 51 return SkImageEncoder::EncodeData(bm, type, quality);
47 } 52 }
48 return NULL; 53 return NULL;
49 } 54 }
OLDNEW
« no previous file with comments | « include/core/SkImage.h ('k') | src/image/SkImagePriv.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698