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

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

Issue 1181913003: add SkCanvas::drawAtlas (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix warnings Created 5 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
« no previous file with comments | « src/pipe/SkGPipeWrite.cpp ('k') | no next file » | 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 /* 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 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 void drawVertices(const SkDraw&, SkCanvas::VertexMode, 244 void drawVertices(const SkDraw&, SkCanvas::VertexMode,
245 int vertexCount, const SkPoint verts[], 245 int vertexCount, const SkPoint verts[],
246 const SkPoint texs[], const SkColor colors[], 246 const SkPoint texs[], const SkColor colors[],
247 SkXfermode* xmode, const uint16_t indices[], 247 SkXfermode* xmode, const uint16_t indices[],
248 int indexCount, const SkPaint& paint) override 248 int indexCount, const SkPaint& paint) override
249 {SkASSERT(0);} 249 {SkASSERT(0);}
250 void drawPatch(const SkDraw&, const SkPoint cubics[12], const SkColor colors [4], 250 void drawPatch(const SkDraw&, const SkPoint cubics[12], const SkColor colors [4],
251 const SkPoint texCoords[4], SkXfermode* xmode, 251 const SkPoint texCoords[4], SkXfermode* xmode,
252 const SkPaint& paint) override 252 const SkPaint& paint) override
253 {SkASSERT(0);} 253 {SkASSERT(0);}
254 void drawAtlas(const SkDraw&, const SkImage* atlas, const SkRSXform[], const SkRect[],
255 const SkColor[], int count, SkXfermode::Mode, const SkPaint&) override
256 {SkASSERT(0);}
257
254 void drawDevice(const SkDraw&, SkBaseDevice*, int x, int y, 258 void drawDevice(const SkDraw&, SkBaseDevice*, int x, int y,
255 const SkPaint&) override 259 const SkPaint&) override
256 {SkASSERT(0);} 260 {SkASSERT(0);}
257 261
258 bool canHandleImageFilter(const SkImageFilter*) override { 262 bool canHandleImageFilter(const SkImageFilter*) override {
259 return false; 263 return false;
260 } 264 }
261 bool filterImage(const SkImageFilter*, const SkBitmap&, 265 bool filterImage(const SkImageFilter*, const SkBitmap&,
262 const SkImageFilter::Context&, SkBitmap*, SkIPoint*) overri de { 266 const SkImageFilter::Context&, SkBitmap*, SkIPoint*) overri de {
263 return false; 267 return false;
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 bool SkDeferredDevice::isFreshFrame() { 353 bool SkDeferredDevice::isFreshFrame() {
350 bool ret = fFreshFrame; 354 bool ret = fFreshFrame;
351 fFreshFrame = false; 355 fFreshFrame = false;
352 return ret; 356 return ret;
353 } 357 }
354 358
355 bool SkDeferredDevice::hasPendingCommands() { 359 bool SkDeferredDevice::hasPendingCommands() {
356 return fPipeController.hasPendingCommands(); 360 return fPipeController.hasPendingCommands();
357 } 361 }
358 362
359 void SkDeferredDevice::aboutToDraw() 363 void SkDeferredDevice::aboutToDraw() {
360 {
361 if (fNotificationClient) { 364 if (fNotificationClient) {
362 fNotificationClient->prepareForDraw(); 365 fNotificationClient->prepareForDraw();
363 } 366 }
364 if (fCanDiscardCanvasContents) { 367 if (fCanDiscardCanvasContents) {
365 if (fSurface) { 368 if (fSurface) {
366 fSurface->notifyContentWillChange(SkSurface::kDiscard_ContentChangeM ode); 369 fSurface->notifyContentWillChange(SkSurface::kDiscard_ContentChangeM ode);
367 } 370 }
368 fCanDiscardCanvasContents = false; 371 fCanDiscardCanvasContents = false;
369 } 372 }
370 } 373 }
(...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after
982 } 985 }
983 986
984 void SkDeferredCanvas::onDrawPatch(const SkPoint cubics[12], const SkColor color s[4], 987 void SkDeferredCanvas::onDrawPatch(const SkPoint cubics[12], const SkColor color s[4],
985 const SkPoint texCoords[4], SkXfermode* xmode , 988 const SkPoint texCoords[4], SkXfermode* xmode ,
986 const SkPaint& paint) { 989 const SkPaint& paint) {
987 AutoImmediateDrawIfNeeded autoDraw(*this, &paint); 990 AutoImmediateDrawIfNeeded autoDraw(*this, &paint);
988 this->drawingCanvas()->drawPatch(cubics, colors, texCoords, xmode, paint); 991 this->drawingCanvas()->drawPatch(cubics, colors, texCoords, xmode, paint);
989 this->recordedDrawCommand(); 992 this->recordedDrawCommand();
990 } 993 }
991 994
995 void SkDeferredCanvas::onDrawAtlas(const SkImage* atlas, const SkRSXform xform[] ,
996 const SkRect tex[], const SkColor colors[], i nt count,
997 SkXfermode::Mode mode, const SkRect* cullRect ,
998 const SkPaint* paint) {
999 AutoImmediateDrawIfNeeded autoDraw(*this, paint);
1000 this->drawingCanvas()->drawAtlas(atlas, xform, tex, colors, count, mode, cul lRect, paint);
1001 this->recordedDrawCommand();
1002 }
1003
992 SkDrawFilter* SkDeferredCanvas::setDrawFilter(SkDrawFilter* filter) { 1004 SkDrawFilter* SkDeferredCanvas::setDrawFilter(SkDrawFilter* filter) {
993 this->drawingCanvas()->setDrawFilter(filter); 1005 this->drawingCanvas()->setDrawFilter(filter);
994 this->INHERITED::setDrawFilter(filter); 1006 this->INHERITED::setDrawFilter(filter);
995 this->recordedDrawCommand(); 1007 this->recordedDrawCommand();
996 return filter; 1008 return filter;
997 } 1009 }
998 1010
999 SkCanvas* SkDeferredCanvas::canvasForDrawIter() { 1011 SkCanvas* SkDeferredCanvas::canvasForDrawIter() {
1000 return this->drawingCanvas(); 1012 return this->drawingCanvas();
1001 } 1013 }
OLDNEW
« no previous file with comments | « src/pipe/SkGPipeWrite.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698