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

Side by Side Diff: src/pdf/SkPDFDevice.cpp

Issue 168653002: Change device factories to take SkImageInfo instead of SkBitmap::Config (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: fix PdfViewer Created 6 years, 10 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/image/SkSurface_Gpu.cpp ('k') | src/utils/SkDeferredCanvas.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 "SkPDFDevice.h" 8 #include "SkPDFDevice.h"
9 9
10 #include "SkAnnotation.h" 10 #include "SkAnnotation.h"
(...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after
578 enum_must_match_value); 578 enum_must_match_value);
579 SK_COMPILE_ASSERT(SkPaint::kStrokeAndFill_Style == 2, 579 SK_COMPILE_ASSERT(SkPaint::kStrokeAndFill_Style == 2,
580 enum_must_match_value); 580 enum_must_match_value);
581 fContentStream->writeDecAsText(state.fTextFill); 581 fContentStream->writeDecAsText(state.fTextFill);
582 fContentStream->writeText(" Tr\n"); 582 fContentStream->writeText(" Tr\n");
583 currentEntry()->fTextFill = state.fTextFill; 583 currentEntry()->fTextFill = state.fTextFill;
584 } 584 }
585 } 585 }
586 } 586 }
587 587
588 SkBaseDevice* SkPDFDevice::onCreateCompatibleDevice(SkBitmap::Config config, 588 SkBaseDevice* SkPDFDevice::onCreateDevice(const SkImageInfo& info, Usage usage) {
589 int width, int height,
590 bool isOpaque,
591 Usage usage) {
592 SkMatrix initialTransform; 589 SkMatrix initialTransform;
593 initialTransform.reset(); 590 initialTransform.reset();
594 SkISize size = SkISize::Make(width, height); 591 SkISize size = SkISize::Make(info.width(), info.height());
595 return SkNEW_ARGS(SkPDFDevice, (size, size, initialTransform)); 592 return SkNEW_ARGS(SkPDFDevice, (size, size, initialTransform));
596 } 593 }
597 594
598 595
599 struct ContentEntry { 596 struct ContentEntry {
600 GraphicStateEntry fState; 597 GraphicStateEntry fState;
601 SkDynamicMemoryWStream fContent; 598 SkDynamicMemoryWStream fContent;
602 SkAutoTDelete<ContentEntry> fNext; 599 SkAutoTDelete<ContentEntry> fNext;
603 600
604 // If the stack is too deep we could get Stack Overflow. 601 // If the stack is too deep we could get Stack Overflow.
(...skipping 1720 matching lines...) Expand 10 before | Expand all | Expand 10 after
2325 } 2322 }
2326 2323
2327 bool SkPDFDevice::onReadPixels(const SkBitmap& bitmap, int x, int y, 2324 bool SkPDFDevice::onReadPixels(const SkBitmap& bitmap, int x, int y,
2328 SkCanvas::Config8888) { 2325 SkCanvas::Config8888) {
2329 return false; 2326 return false;
2330 } 2327 }
2331 2328
2332 bool SkPDFDevice::allowImageFilter(const SkImageFilter*) { 2329 bool SkPDFDevice::allowImageFilter(const SkImageFilter*) {
2333 return false; 2330 return false;
2334 } 2331 }
OLDNEW
« no previous file with comments | « src/image/SkSurface_Gpu.cpp ('k') | src/utils/SkDeferredCanvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698