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

Side by Side Diff: src/utils/SkDeferredCanvas.cpp

Issue 719253002: rename filterTextFlags to disableLCD (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 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
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2013 Google Inc. 3 * Copyright 2013 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #include "SkDeferredCanvas.h" 9 #include "SkDeferredCanvas.h"
10 10
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 161
162 virtual SkBaseDevice* onCreateDevice(const SkImageInfo&, Usage) SK_OVERRIDE; 162 virtual SkBaseDevice* onCreateDevice(const SkImageInfo&, Usage) SK_OVERRIDE;
163 163
164 virtual SkSurface* newSurface(const SkImageInfo&, const SkSurfaceProps&) SK_ OVERRIDE; 164 virtual SkSurface* newSurface(const SkImageInfo&, const SkSurfaceProps&) SK_ OVERRIDE;
165 165
166 protected: 166 protected:
167 virtual const SkBitmap& onAccessBitmap() SK_OVERRIDE; 167 virtual const SkBitmap& onAccessBitmap() SK_OVERRIDE;
168 virtual bool onReadPixels(const SkImageInfo&, void*, size_t, int x, int y) S K_OVERRIDE; 168 virtual bool onReadPixels(const SkImageInfo&, void*, size_t, int x, int y) S K_OVERRIDE;
169 virtual bool onWritePixels(const SkImageInfo&, const void*, size_t, int x, i nt y) SK_OVERRIDE; 169 virtual bool onWritePixels(const SkImageInfo&, const void*, size_t, int x, i nt y) SK_OVERRIDE;
170 170
171 // The following methods are no-ops on a deferred device
172 virtual bool filterTextFlags(const SkPaint& paint, TextFlags*) SK_OVERRIDE {
173 return false;
174 }
175
176 // None of the following drawing methods should ever get called on the 171 // None of the following drawing methods should ever get called on the
177 // deferred device 172 // deferred device
178 virtual void clear(SkColor color) SK_OVERRIDE 173 virtual void clear(SkColor color) SK_OVERRIDE
179 {SkASSERT(0);} 174 {SkASSERT(0);}
180 virtual void drawPaint(const SkDraw&, const SkPaint& paint) SK_OVERRIDE 175 virtual void drawPaint(const SkDraw&, const SkPaint& paint) SK_OVERRIDE
181 {SkASSERT(0);} 176 {SkASSERT(0);}
182 virtual void drawPoints(const SkDraw&, SkCanvas::PointMode mode, 177 virtual void drawPoints(const SkDraw&, SkCanvas::PointMode mode,
183 size_t count, const SkPoint[], 178 size_t count, const SkPoint[],
184 const SkPaint& paint) SK_OVERRIDE 179 const SkPaint& paint) SK_OVERRIDE
185 {SkASSERT(0);} 180 {SkASSERT(0);}
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 return immediateDevice()->onWritePixels(info, pixels, rowBytes, x, y); 453 return immediateDevice()->onWritePixels(info, pixels, rowBytes, x, y);
459 } 454 }
460 455
461 const SkBitmap& SkDeferredDevice::onAccessBitmap() { 456 const SkBitmap& SkDeferredDevice::onAccessBitmap() {
462 this->flushPendingCommands(kNormal_PlaybackMode); 457 this->flushPendingCommands(kNormal_PlaybackMode);
463 return immediateDevice()->accessBitmap(false); 458 return immediateDevice()->accessBitmap(false);
464 } 459 }
465 460
466 SkBaseDevice* SkDeferredDevice::onCreateDevice(const SkImageInfo& info, Usage us age) { 461 SkBaseDevice* SkDeferredDevice::onCreateDevice(const SkImageInfo& info, Usage us age) {
467 // Save layer usage not supported, and not required by SkDeferredCanvas. 462 // Save layer usage not supported, and not required by SkDeferredCanvas.
468 SkASSERT(usage != kSaveLayer_Usage); 463 SkASSERT(usage == kGeneral_Usage);
469 // Create a compatible non-deferred device. 464 // Create a compatible non-deferred device.
470 // We do not create a deferred device because we know the new device 465 // We do not create a deferred device because we know the new device
471 // will not be used with a deferred canvas (there is no API for that). 466 // will not be used with a deferred canvas (there is no API for that).
472 // And connecting a SkDeferredDevice to non-deferred canvas can result 467 // And connecting a SkDeferredDevice to non-deferred canvas can result
473 // in unpredictable behavior. 468 // in unpredictable behavior.
474 return immediateDevice()->createCompatibleDevice(info); 469 return immediateDevice()->onCreateDevice(info, usage);
475 } 470 }
476 471
477 SkSurface* SkDeferredDevice::newSurface(const SkImageInfo& info, const SkSurface Props& props) { 472 SkSurface* SkDeferredDevice::newSurface(const SkImageInfo& info, const SkSurface Props& props) {
478 return this->immediateDevice()->newSurface(info, props); 473 return this->immediateDevice()->newSurface(info, props);
479 } 474 }
480 475
481 bool SkDeferredDevice::onReadPixels(const SkImageInfo& info, void* pixels, size_ t rowBytes, 476 bool SkDeferredDevice::onReadPixels(const SkImageInfo& info, void* pixels, size_ t rowBytes,
482 int x, int y) { 477 int x, int y) {
483 this->flushPendingCommands(kNormal_PlaybackMode); 478 this->flushPendingCommands(kNormal_PlaybackMode);
484 return fImmediateCanvas->readPixels(info, pixels, rowBytes, x, y); 479 return fImmediateCanvas->readPixels(info, pixels, rowBytes, x, y);
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after
948 SkDrawFilter* SkDeferredCanvas::setDrawFilter(SkDrawFilter* filter) { 943 SkDrawFilter* SkDeferredCanvas::setDrawFilter(SkDrawFilter* filter) {
949 this->drawingCanvas()->setDrawFilter(filter); 944 this->drawingCanvas()->setDrawFilter(filter);
950 this->INHERITED::setDrawFilter(filter); 945 this->INHERITED::setDrawFilter(filter);
951 this->recordedDrawCommand(); 946 this->recordedDrawCommand();
952 return filter; 947 return filter;
953 } 948 }
954 949
955 SkCanvas* SkDeferredCanvas::canvasForDrawIter() { 950 SkCanvas* SkDeferredCanvas::canvasForDrawIter() {
956 return this->drawingCanvas(); 951 return this->drawingCanvas();
957 } 952 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698