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

Side by Side Diff: src/device/xps/SkXPSDevice.cpp

Issue 301283003: Revert "Revert of setConfig -> setInfo (https://codereview.chromium.org/308683005/)" (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: add guard for android Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « src/core/SkValidationUtils.h ('k') | src/effects/SkPerlinNoiseShader.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 #ifndef UNICODE 8 #ifndef UNICODE
9 #define UNICODE 9 #define UNICODE
10 #endif 10 #endif
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 99
100 if (format_guid(guid, buffer, bufferSize, sep) == -1) { 100 if (format_guid(guid, buffer, bufferSize, sep) == -1) {
101 HRM(E_UNEXPECTED, "Could not format GUID into id."); 101 HRM(E_UNEXPECTED, "Could not format GUID into id.");
102 } 102 }
103 103
104 return S_OK; 104 return S_OK;
105 } 105 }
106 106
107 static SkBitmap make_fake_bitmap(int width, int height) { 107 static SkBitmap make_fake_bitmap(int width, int height) {
108 SkBitmap bitmap; 108 SkBitmap bitmap;
109 bitmap.setConfig(SkImageInfo::MakeUnknown(width, height)); 109 bitmap.setInfo(SkImageInfo::MakeUnknown(width, height));
110 return bitmap; 110 return bitmap;
111 } 111 }
112 112
113 // TODO: should inherit from SkBaseDevice instead of SkBitmapDevice... 113 // TODO: should inherit from SkBaseDevice instead of SkBitmapDevice...
114 SkXPSDevice::SkXPSDevice() 114 SkXPSDevice::SkXPSDevice()
115 : SkBitmapDevice(make_fake_bitmap(10000, 10000)) 115 : SkBitmapDevice(make_fake_bitmap(10000, 10000))
116 , fCurrentPage(0) { 116 , fCurrentPage(0) {
117 } 117 }
118 118
119 SkXPSDevice::~SkXPSDevice() { 119 SkXPSDevice::~SkXPSDevice() {
(...skipping 1462 matching lines...) Expand 10 before | Expand all | Expand 10 after
1582 m.reset(); 1582 m.reset();
1583 m.setTranslate(SkIntToScalar(mask.fBounds.fLeft), 1583 m.setTranslate(SkIntToScalar(mask.fBounds.fLeft),
1584 SkIntToScalar(mask.fBounds.fTop)); 1584 SkIntToScalar(mask.fBounds.fTop));
1585 m.postScale(SkScalarInvert(ppuScale.fX), SkScalarInvert(ppuScale.fY)); 1585 m.postScale(SkScalarInvert(ppuScale.fX), SkScalarInvert(ppuScale.fY));
1586 1586
1587 SkShader::TileMode xy[2]; 1587 SkShader::TileMode xy[2];
1588 xy[0] = (SkShader::TileMode)3; 1588 xy[0] = (SkShader::TileMode)3;
1589 xy[1] = (SkShader::TileMode)3; 1589 xy[1] = (SkShader::TileMode)3;
1590 1590
1591 SkBitmap bm; 1591 SkBitmap bm;
1592 bm.setConfig(SkBitmap::kA8_Config, 1592 bm.installMaskPixels(mask);
1593 mask.fBounds.width(),
1594 mask.fBounds.height(),
1595 mask.fRowBytes);
1596 bm.setPixels(mask.fImage);
1597 1593
1598 SkTScopedComPtr<IXpsOMTileBrush> maskBrush; 1594 SkTScopedComPtr<IXpsOMTileBrush> maskBrush;
1599 HR(this->createXpsImageBrush(bm, m, xy, 0xFF, &maskBrush)); 1595 HR(this->createXpsImageBrush(bm, m, xy, 0xFF, &maskBrush));
1600 HRM(shadedPath->SetOpacityMaskBrushLocal(maskBrush.get()), 1596 HRM(shadedPath->SetOpacityMaskBrushLocal(maskBrush.get()),
1601 "Could not set mask."); 1597 "Could not set mask.");
1602 1598
1603 const SkRect universeRect = SkRect::MakeLTRB(0, 0, 1599 const SkRect universeRect = SkRect::MakeLTRB(0, 0,
1604 this->fCurrentCanvasSize.fWidth, this->fCurrentCanvasSize.fHeight); 1600 this->fCurrentCanvasSize.fWidth, this->fCurrentCanvasSize.fHeight);
1605 SkTScopedComPtr<IXpsOMGeometryFigure> shadedFigure; 1601 SkTScopedComPtr<IXpsOMGeometryFigure> shadedFigure;
1606 HRM(this->createXpsRect(universeRect, FALSE, TRUE, &shadedFigure), 1602 HRM(this->createXpsRect(universeRect, FALSE, TRUE, &shadedFigure),
(...skipping 828 matching lines...) Expand 10 before | Expand all | Expand 10 after
2435 IID_PPV_ARGS(&this->fXpsFactory)), 2431 IID_PPV_ARGS(&this->fXpsFactory)),
2436 "Could not create factory for layer."); 2432 "Could not create factory for layer.");
2437 2433
2438 HRVM(this->fXpsFactory->CreateCanvas(&this->fCurrentXpsCanvas), 2434 HRVM(this->fXpsFactory->CreateCanvas(&this->fCurrentXpsCanvas),
2439 "Could not create canvas for layer."); 2435 "Could not create canvas for layer.");
2440 } 2436 }
2441 2437
2442 bool SkXPSDevice::allowImageFilter(const SkImageFilter*) { 2438 bool SkXPSDevice::allowImageFilter(const SkImageFilter*) {
2443 return false; 2439 return false;
2444 } 2440 }
OLDNEW
« no previous file with comments | « src/core/SkValidationUtils.h ('k') | src/effects/SkPerlinNoiseShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698