| 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 30 matching lines...) Expand all Loading... |
| 41 SampleCode::TitleR(evt, "Texture Domain"); | 41 SampleCode::TitleR(evt, "Texture Domain"); |
| 42 return true; | 42 return true; |
| 43 } | 43 } |
| 44 return this->INHERITED::onQuery(evt); | 44 return this->INHERITED::onQuery(evt); |
| 45 } | 45 } |
| 46 | 46 |
| 47 virtual void onDrawContent(SkCanvas* canvas) { | 47 virtual void onDrawContent(SkCanvas* canvas) { |
| 48 SkIRect srcRect; | 48 SkIRect srcRect; |
| 49 SkRect dstRect; | 49 SkRect dstRect; |
| 50 SkPaint paint; | 50 SkPaint paint; |
| 51 paint.setFilterBitmap(true); | 51 paint.setFilterLevel(SkPaint::kLow_FilterLevel); |
| 52 | 52 |
| 53 // Test that bitmap draws from malloc-backed bitmaps respect | 53 // Test that bitmap draws from malloc-backed bitmaps respect |
| 54 // the constrained texture domain. | 54 // the constrained texture domain. |
| 55 srcRect.setXYWH(1, 1, 3, 3); | 55 srcRect.setXYWH(1, 1, 3, 3); |
| 56 dstRect.setXYWH(5.0f, 5.0f, 305.0f, 305.0f); | 56 dstRect.setXYWH(5.0f, 5.0f, 305.0f, 305.0f); |
| 57 canvas->drawBitmapRect(fBM, &srcRect, dstRect, &paint); | 57 canvas->drawBitmapRect(fBM, &srcRect, dstRect, &paint); |
| 58 | 58 |
| 59 // Test that bitmap draws across separate devices also respect | 59 // Test that bitmap draws across separate devices also respect |
| 60 // the constrainted texture domain. | 60 // the constrainted texture domain. |
| 61 // Note: GPU-backed bitmaps follow a different rendering path | 61 // Note: GPU-backed bitmaps follow a different rendering path |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 canvas->drawBitmapRect(fBM, NULL, dstRect, &paint); | 103 canvas->drawBitmapRect(fBM, NULL, dstRect, &paint); |
| 104 } | 104 } |
| 105 private: | 105 private: |
| 106 typedef SkView INHERITED; | 106 typedef SkView INHERITED; |
| 107 }; | 107 }; |
| 108 | 108 |
| 109 ////////////////////////////////////////////////////////////////////////////// | 109 ////////////////////////////////////////////////////////////////////////////// |
| 110 | 110 |
| 111 static SkView* MyFactory() { return new TextureDomainView; } | 111 static SkView* MyFactory() { return new TextureDomainView; } |
| 112 static SkViewRegister reg(MyFactory); | 112 static SkViewRegister reg(MyFactory); |
| OLD | NEW |