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

Side by Side Diff: src/core/SkDevice.cpp

Issue 1008863002: Revert of Change device creation to see the (optional) layer-paint (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 9 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/core/SkCanvas.cpp ('k') | src/core/SkDeviceImageFilterProxy.h » ('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 "SkDevice.h" 8 #include "SkDevice.h"
9 #include "SkDeviceProperties.h" 9 #include "SkDeviceProperties.h"
10 #include "SkDraw.h" 10 #include "SkDraw.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 57
58 const SkBitmap& SkBaseDevice::accessBitmap(bool changePixels) { 58 const SkBitmap& SkBaseDevice::accessBitmap(bool changePixels) {
59 const SkBitmap& bitmap = this->onAccessBitmap(); 59 const SkBitmap& bitmap = this->onAccessBitmap();
60 if (changePixels) { 60 if (changePixels) {
61 bitmap.notifyPixelsChanged(); 61 bitmap.notifyPixelsChanged();
62 } 62 }
63 return bitmap; 63 return bitmap;
64 } 64 }
65 65
66 SkPixelGeometry SkBaseDevice::CreateInfo::AdjustGeometry(const SkImageInfo& info , 66 SkPixelGeometry SkBaseDevice::CreateInfo::AdjustGeometry(const SkImageInfo& info ,
67 TileUsage tileUsage, 67 Usage usage,
68 SkPixelGeometry geo) { 68 SkPixelGeometry geo) {
69 switch (tileUsage) { 69 switch (usage) {
70 case kPossible_TileUsage: 70 case kGeneral_Usage:
71 break; 71 break;
72 case kNever_TileUsage: 72 case kSaveLayer_Usage:
73 if (info.alphaType() != kOpaque_SkAlphaType) { 73 if (info.alphaType() != kOpaque_SkAlphaType) {
74 geo = kUnknown_SkPixelGeometry; 74 geo = kUnknown_SkPixelGeometry;
75 } 75 }
76 break; 76 break;
77 case kImageFilter_Usage:
78 geo = kUnknown_SkPixelGeometry;
79 break;
77 } 80 }
78 return geo; 81 return geo;
79 } 82 }
80 83
81 void SkBaseDevice::initForRootLayer(SkPixelGeometry geo) { 84 void SkBaseDevice::initForRootLayer(SkPixelGeometry geo) {
82 // For now we don't expect to change the geometry for the root-layer, but we make the call 85 // For now we don't expect to change the geometry for the root-layer, but we make the call
83 // anyway to document logically what is going on. 86 // anyway to document logically what is going on.
84 // 87 //
85 fLeakyProperties->setPixelGeometry(CreateInfo::AdjustGeometry(this->imageInf o(), 88 fLeakyProperties->setPixelGeometry(CreateInfo::AdjustGeometry(this->imageInf o(),
86 kPossible_Tile Usage, 89 kGeneral_Usage ,
87 geo)); 90 geo));
88 } 91 }
89 92
90 SkSurface* SkBaseDevice::newSurface(const SkImageInfo&, const SkSurfaceProps&) { return NULL; } 93 SkSurface* SkBaseDevice::newSurface(const SkImageInfo&, const SkSurfaceProps&) { return NULL; }
91 94
92 const void* SkBaseDevice::peekPixels(SkImageInfo*, size_t*) { return NULL; } 95 const void* SkBaseDevice::peekPixels(SkImageInfo*, size_t*) { return NULL; }
93 96
94 void SkBaseDevice::drawDRRect(const SkDraw& draw, const SkRRect& outer, 97 void SkBaseDevice::drawDRRect(const SkDraw& draw, const SkRRect& outer,
95 const SkRRect& inner, const SkPaint& paint) { 98 const SkRRect& inner, const SkPaint& paint) {
96 SkPath path; 99 SkPath path;
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 if (kUnknown_SkPixelGeometry == fLeakyProperties->pixelGeometry() 359 if (kUnknown_SkPixelGeometry == fLeakyProperties->pixelGeometry()
357 || this->onShouldDisableLCD(paint)) { 360 || this->onShouldDisableLCD(paint)) {
358 361
359 flags &= ~SkPaint::kLCDRenderText_Flag; 362 flags &= ~SkPaint::kLCDRenderText_Flag;
360 flags |= SkPaint::kGenA8FromLCD_Flag; 363 flags |= SkPaint::kGenA8FromLCD_Flag;
361 } 364 }
362 365
363 return flags; 366 return flags;
364 } 367 }
365 368
OLDNEW
« no previous file with comments | « src/core/SkCanvas.cpp ('k') | src/core/SkDeviceImageFilterProxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698