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

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

Issue 577063004: Refactoring in SkImage implementations backed by a SkBitmap (Closed) Base URL: https://skia.googlesource.com/skia.git@small_refactor_skimageCodec
Patch Set: Comments Created 6 years, 3 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 | « src/image/SkImage_BitmapBase.h ('k') | src/image/SkImage_Codec.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright 2014 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8 #include "SkImage_BitmapBase.h"
9
10 #include "SkCanvas.h"
11
12 SkImage_BitmapBase::SkImage_BitmapBase(int width, int height)
13 : INHERITED(width, height) {
14 }
15
16 SkImage_BitmapBase::SkImage_BitmapBase(const SkBitmap& bitmap)
17 : INHERITED(bitmap.width(), bitmap.height())
18 , fBitmap(bitmap) {
19 }
20
21 bool SkImage_BitmapBase::isOpaque() const {
22 return this->getBitmap().isOpaque();
23 }
24
25 SkShader* SkImage_BitmapBase::onNewShader(SkShader::TileMode tileX,
26 SkShader::TileMode tileY,
27 const SkMatrix* localMatrix) const
28 {
29 return SkShader::CreateBitmapShader(this->getBitmap(), tileX, tileY, localMa trix);
30 }
31
32 void SkImage_BitmapBase::onDraw(SkCanvas* canvas, SkScalar x, SkScalar y, const SkPaint* paint) const {
33 canvas->drawBitmap(this->getBitmap(), x, y, paint);
34 }
35
36 void SkImage_BitmapBase::onDrawRectToRect(SkCanvas* canvas, const SkRect* src, c onst SkRect& dst,
37 const SkPaint* paint) const {
38 canvas->drawBitmapRectToRect(this->getBitmap(), src, dst, paint);
39 }
OLDNEW
« no previous file with comments | « src/image/SkImage_BitmapBase.h ('k') | src/image/SkImage_Codec.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698