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

Unified Diff: src/image/SkImage_Gpu.cpp

Issue 453613003: mark all SkImage methods const, so we can make it thread-safe (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/image/SkImage_Codec.cpp ('k') | src/image/SkImage_Raster.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/image/SkImage_Gpu.cpp
diff --git a/src/image/SkImage_Gpu.cpp b/src/image/SkImage_Gpu.cpp
index 81114b0fe8d1dfa59a17a9f1c148b4ed7f93f35d..0918412e83c1decbb2bad6e9d26dc8501d73ce55 100644
--- a/src/image/SkImage_Gpu.cpp
+++ b/src/image/SkImage_Gpu.cpp
@@ -20,12 +20,13 @@ public:
explicit SkImage_Gpu(const SkBitmap&);
virtual ~SkImage_Gpu();
- virtual void onDraw(SkCanvas*, SkScalar x, SkScalar y, const SkPaint*) SK_OVERRIDE;
- virtual void onDrawRectToRect(SkCanvas*, const SkRect* src, const SkRect& dst, const SkPaint*) SK_OVERRIDE;
- virtual GrTexture* onGetTexture() SK_OVERRIDE;
+ virtual void onDraw(SkCanvas*, SkScalar x, SkScalar y, const SkPaint*) const SK_OVERRIDE;
+ virtual void onDrawRectToRect(SkCanvas*, const SkRect* src, const SkRect& dst,
+ const SkPaint*) const SK_OVERRIDE;
+ virtual GrTexture* onGetTexture() const SK_OVERRIDE;
virtual bool getROPixels(SkBitmap*) const SK_OVERRIDE;
- GrTexture* getTexture() { return fBitmap.getTexture(); }
+ GrTexture* getTexture() const { return fBitmap.getTexture(); }
virtual SkShader* onNewShader(SkShader::TileMode,
SkShader::TileMode,
@@ -54,17 +55,16 @@ SkShader* SkImage_Gpu::onNewShader(SkShader::TileMode tileX,
return SkShader::CreateBitmapShader(fBitmap, tileX, tileY, localMatrix);
}
-void SkImage_Gpu::onDraw(SkCanvas* canvas, SkScalar x, SkScalar y,
- const SkPaint* paint) {
+void SkImage_Gpu::onDraw(SkCanvas* canvas, SkScalar x, SkScalar y, const SkPaint* paint) const {
canvas->drawBitmap(fBitmap, x, y, paint);
}
void SkImage_Gpu::onDrawRectToRect(SkCanvas* canvas, const SkRect* src, const SkRect& dst,
- const SkPaint* paint) {
+ const SkPaint* paint) const {
canvas->drawBitmapRectToRect(fBitmap, src, dst, paint);
}
-GrTexture* SkImage_Gpu::onGetTexture() {
+GrTexture* SkImage_Gpu::onGetTexture() const {
return fBitmap.getTexture();
}
« no previous file with comments | « src/image/SkImage_Codec.cpp ('k') | src/image/SkImage_Raster.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698