OLD | NEW |
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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 size_t freeMemoryIfPossible(size_t bytesToFree); | 152 size_t freeMemoryIfPossible(size_t bytesToFree); |
153 size_t getBitmapSizeThreshold() const; | 153 size_t getBitmapSizeThreshold() const; |
154 void setBitmapSizeThreshold(size_t sizeThreshold); | 154 void setBitmapSizeThreshold(size_t sizeThreshold); |
155 void flushPendingCommands(PlaybackMode); | 155 void flushPendingCommands(PlaybackMode); |
156 void skipPendingCommands(); | 156 void skipPendingCommands(); |
157 void setMaxRecordingStorage(size_t); | 157 void setMaxRecordingStorage(size_t); |
158 void recordedDrawCommand(); | 158 void recordedDrawCommand(); |
159 | 159 |
160 virtual int width() const SK_OVERRIDE; | 160 virtual int width() const SK_OVERRIDE; |
161 virtual int height() const SK_OVERRIDE; | 161 virtual int height() const SK_OVERRIDE; |
162 #ifdef SK_SUPPORT_LEGACY_DEVICE_CONFIG | |
163 virtual SkBitmap::Config config() const SK_OVERRIDE; | |
164 #endif | |
165 virtual bool isOpaque() const SK_OVERRIDE; | 162 virtual bool isOpaque() const SK_OVERRIDE; |
166 virtual SkImageInfo imageInfo() const SK_OVERRIDE; | 163 virtual SkImageInfo imageInfo() const SK_OVERRIDE; |
167 | 164 |
168 virtual GrRenderTarget* accessRenderTarget() SK_OVERRIDE; | 165 virtual GrRenderTarget* accessRenderTarget() SK_OVERRIDE; |
169 | 166 |
170 virtual SkBaseDevice* onCreateDevice(const SkImageInfo&, Usage) SK_OVERRIDE; | 167 virtual SkBaseDevice* onCreateDevice(const SkImageInfo&, Usage) SK_OVERRIDE; |
171 | 168 |
172 virtual SkSurface* newSurface(const SkImageInfo&) SK_OVERRIDE; | 169 virtual SkSurface* newSurface(const SkImageInfo&) SK_OVERRIDE; |
173 | 170 |
174 protected: | 171 protected: |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
430 } | 427 } |
431 | 428 |
432 int SkDeferredDevice::width() const { | 429 int SkDeferredDevice::width() const { |
433 return immediateDevice()->width(); | 430 return immediateDevice()->width(); |
434 } | 431 } |
435 | 432 |
436 int SkDeferredDevice::height() const { | 433 int SkDeferredDevice::height() const { |
437 return immediateDevice()->height(); | 434 return immediateDevice()->height(); |
438 } | 435 } |
439 | 436 |
440 #ifdef SK_SUPPORT_LEGACY_DEVICE_CONFIG | |
441 SkBitmap::Config SkDeferredDevice::config() const { | |
442 return immediateDevice()->config(); | |
443 } | |
444 #endif | |
445 | |
446 bool SkDeferredDevice::isOpaque() const { | 437 bool SkDeferredDevice::isOpaque() const { |
447 return immediateDevice()->isOpaque(); | 438 return immediateDevice()->isOpaque(); |
448 } | 439 } |
449 | 440 |
450 SkImageInfo SkDeferredDevice::imageInfo() const { | 441 SkImageInfo SkDeferredDevice::imageInfo() const { |
451 return immediateDevice()->imageInfo(); | 442 return immediateDevice()->imageInfo(); |
452 } | 443 } |
453 | 444 |
454 GrRenderTarget* SkDeferredDevice::accessRenderTarget() { | 445 GrRenderTarget* SkDeferredDevice::accessRenderTarget() { |
455 this->flushPendingCommands(kNormal_PlaybackMode); | 446 this->flushPendingCommands(kNormal_PlaybackMode); |
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
956 SkDrawFilter* SkDeferredCanvas::setDrawFilter(SkDrawFilter* filter) { | 947 SkDrawFilter* SkDeferredCanvas::setDrawFilter(SkDrawFilter* filter) { |
957 this->drawingCanvas()->setDrawFilter(filter); | 948 this->drawingCanvas()->setDrawFilter(filter); |
958 this->INHERITED::setDrawFilter(filter); | 949 this->INHERITED::setDrawFilter(filter); |
959 this->recordedDrawCommand(); | 950 this->recordedDrawCommand(); |
960 return filter; | 951 return filter; |
961 } | 952 } |
962 | 953 |
963 SkCanvas* SkDeferredCanvas::canvasForDrawIter() { | 954 SkCanvas* SkDeferredCanvas::canvasForDrawIter() { |
964 return this->drawingCanvas(); | 955 return this->drawingCanvas(); |
965 } | 956 } |
OLD | NEW |