| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 "SampleCode.h" | 8 #include "SampleCode.h" |
| 9 #include "SkBlurMask.h" | 9 #include "SkBlurMask.h" |
| 10 #include "SkBlurMaskFilter.h" | 10 #include "SkBlurMaskFilter.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 SampleCode::TitleR(evt, "Texture Domain"); | 40 SampleCode::TitleR(evt, "Texture Domain"); |
| 41 return true; | 41 return true; |
| 42 } | 42 } |
| 43 return this->INHERITED::onQuery(evt); | 43 return this->INHERITED::onQuery(evt); |
| 44 } | 44 } |
| 45 | 45 |
| 46 virtual void onDrawContent(SkCanvas* canvas) { | 46 virtual void onDrawContent(SkCanvas* canvas) { |
| 47 SkRect srcRect; | 47 SkRect srcRect; |
| 48 SkRect dstRect; | 48 SkRect dstRect; |
| 49 SkPaint paint; | 49 SkPaint paint; |
| 50 paint.setFilterLevel(SkPaint::kLow_FilterLevel); | 50 paint.setFilterQuality(kLow_SkFilterQuality); |
| 51 | 51 |
| 52 // Test that bitmap draws from malloc-backed bitmaps respect | 52 // Test that bitmap draws from malloc-backed bitmaps respect |
| 53 // the constrained texture domain. | 53 // the constrained texture domain. |
| 54 srcRect.setXYWH(1, 1, 3, 3); | 54 srcRect.setXYWH(1, 1, 3, 3); |
| 55 dstRect.setXYWH(5, 5, 305, 305); | 55 dstRect.setXYWH(5, 5, 305, 305); |
| 56 canvas->drawBitmapRectToRect(fBM, &srcRect, dstRect, &paint); | 56 canvas->drawBitmapRectToRect(fBM, &srcRect, dstRect, &paint); |
| 57 | 57 |
| 58 // Test that bitmap draws across separate devices also respect | 58 // Test that bitmap draws across separate devices also respect |
| 59 // the constrainted texture domain. | 59 // the constrainted texture domain. |
| 60 // Note: GPU-backed bitmaps follow a different rendering path | 60 // Note: GPU-backed bitmaps follow a different rendering path |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 canvas->drawBitmapRectToRect(fBM, NULL, dstRect, &paint); | 101 canvas->drawBitmapRectToRect(fBM, NULL, dstRect, &paint); |
| 102 } | 102 } |
| 103 private: | 103 private: |
| 104 typedef SkView INHERITED; | 104 typedef SkView INHERITED; |
| 105 }; | 105 }; |
| 106 | 106 |
| 107 ////////////////////////////////////////////////////////////////////////////// | 107 ////////////////////////////////////////////////////////////////////////////// |
| 108 | 108 |
| 109 static SkView* MyFactory() { return new TextureDomainView; } | 109 static SkView* MyFactory() { return new TextureDomainView; } |
| 110 static SkViewRegister reg(MyFactory); | 110 static SkViewRegister reg(MyFactory); |
| OLD | NEW |