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

Side by Side Diff: samplecode/SampleTextureDomain.cpp

Issue 51033004: add SK_ATTR_DEPRECATED -- will need to disable for chrome, since it triggers a warning (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « samplecode/SampleSlides.cpp ('k') | samplecode/SampleTiling.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 * 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
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
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);
OLDNEW
« no previous file with comments | « samplecode/SampleSlides.cpp ('k') | samplecode/SampleTiling.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698