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

Side by Side Diff: src/utils/debugger/SkDrawCommand.cpp

Issue 1240753003: Revert[2] of guard to remove DrawBitmapRectFlags (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 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
« no previous file with comments | « src/utils/SkNinePatch.cpp ('k') | tests/DrawBitmapRectTest.cpp » ('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 /* 2 /*
3 * Copyright 2012 Google Inc. 3 * Copyright 2012 Google Inc.
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 #include "SkDrawCommand.h" 10 #include "SkDrawCommand.h"
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 yScale *= input.height() / (float) input.width(); 122 yScale *= input.height() / (float) input.width();
123 } else { 123 } else {
124 xScale *= input.width() / (float) input.height(); 124 xScale *= input.width() / (float) input.height();
125 } 125 }
126 126
127 SkRect dst = SkRect::MakeXYWH(SK_Scalar1, SK_Scalar1, 127 SkRect dst = SkRect::MakeXYWH(SK_Scalar1, SK_Scalar1,
128 xScale * input.width(), 128 xScale * input.width(),
129 yScale * input.height()); 129 yScale * input.height());
130 130
131 canvas->clear(0xFFFFFFFF); 131 canvas->clear(0xFFFFFFFF);
132 canvas->drawBitmapRect(input, NULL, dst); 132 canvas->drawBitmapRect(input, dst);
133 133
134 if (srcRect) { 134 if (srcRect) {
135 SkRect r = SkRect::MakeLTRB(srcRect->fLeft * xScale + SK_Scalar1, 135 SkRect r = SkRect::MakeLTRB(srcRect->fLeft * xScale + SK_Scalar1,
136 srcRect->fTop * yScale + SK_Scalar1, 136 srcRect->fTop * yScale + SK_Scalar1,
137 srcRect->fRight * xScale + SK_Scalar1, 137 srcRect->fRight * xScale + SK_Scalar1,
138 srcRect->fBottom * yScale + SK_Scalar1); 138 srcRect->fBottom * yScale + SK_Scalar1);
139 SkPaint p; 139 SkPaint p;
140 p.setColor(SK_ColorRED); 140 p.setColor(SK_ColorRED);
141 p.setStyle(SkPaint::kStroke_Style); 141 p.setStyle(SkPaint::kStroke_Style);
142 142
(...skipping 744 matching lines...) Expand 10 before | Expand all | Expand 10 after
887 887
888 void SkSetMatrixCommand::setUserMatrix(const SkMatrix& userMatrix) { 888 void SkSetMatrixCommand::setUserMatrix(const SkMatrix& userMatrix) {
889 fUserMatrix = userMatrix; 889 fUserMatrix = userMatrix;
890 } 890 }
891 891
892 void SkSetMatrixCommand::execute(SkCanvas* canvas) const { 892 void SkSetMatrixCommand::execute(SkCanvas* canvas) const {
893 SkMatrix temp = SkMatrix::Concat(fUserMatrix, fMatrix); 893 SkMatrix temp = SkMatrix::Concat(fUserMatrix, fMatrix);
894 canvas->setMatrix(temp); 894 canvas->setMatrix(temp);
895 } 895 }
896 896
OLDNEW
« no previous file with comments | « src/utils/SkNinePatch.cpp ('k') | tests/DrawBitmapRectTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698