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

Side by Side Diff: src/core/SkCanvas.cpp

Issue 211683002: Add discard API to SkCanvas, plumb it to glDiscardFramebuffer() (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: move to ToT Created 6 years, 8 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 | « include/gpu/GrRenderTarget.h ('k') | src/gpu/GrContext.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 /* 2 /*
3 * Copyright 2008 The Android Open Source Project 3 * Copyright 2008 The Android Open Source Project
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 9
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 1894 matching lines...) Expand 10 before | Expand all | Expand 10 after
1905 ////////////////////////////////////////////////////////////////////////////// 1905 //////////////////////////////////////////////////////////////////////////////
1906 1906
1907 void SkCanvas::clear(SkColor color) { 1907 void SkCanvas::clear(SkColor color) {
1908 SkDrawIter iter(this); 1908 SkDrawIter iter(this);
1909 this->predrawNotify(); 1909 this->predrawNotify();
1910 while (iter.next()) { 1910 while (iter.next()) {
1911 iter.fDevice->clear(color); 1911 iter.fDevice->clear(color);
1912 } 1912 }
1913 } 1913 }
1914 1914
1915 void SkCanvas::onDiscard() {
1916 if (NULL != fSurfaceBase) {
1917 fSurfaceBase->aboutToDraw(SkSurface::kDiscard_ContentChangeMode);
1918 }
1919 }
1920
1915 void SkCanvas::drawPaint(const SkPaint& paint) { 1921 void SkCanvas::drawPaint(const SkPaint& paint) {
1916 this->internalDrawPaint(paint); 1922 this->internalDrawPaint(paint);
1917 } 1923 }
1918 1924
1919 void SkCanvas::internalDrawPaint(const SkPaint& paint) { 1925 void SkCanvas::internalDrawPaint(const SkPaint& paint) {
1920 CHECK_SHADER_NOSETCONTEXT(paint); 1926 CHECK_SHADER_NOSETCONTEXT(paint);
1921 1927
1922 LOOPER_BEGIN(paint, SkDrawFilter::kPaint_Type, NULL) 1928 LOOPER_BEGIN(paint, SkDrawFilter::kPaint_Type, NULL)
1923 1929
1924 while (iter.next()) { 1930 while (iter.next()) {
(...skipping 717 matching lines...) Expand 10 before | Expand all | Expand 10 after
2642 if (!bitmap.installPixels(info, pixels, rowBytes)) { 2648 if (!bitmap.installPixels(info, pixels, rowBytes)) {
2643 return NULL; 2649 return NULL;
2644 } 2650 }
2645 2651
2646 // should this functionality be moved into allocPixels()? 2652 // should this functionality be moved into allocPixels()?
2647 if (!bitmap.info().isOpaque()) { 2653 if (!bitmap.info().isOpaque()) {
2648 bitmap.eraseColor(0); 2654 bitmap.eraseColor(0);
2649 } 2655 }
2650 return SkNEW_ARGS(SkCanvas, (bitmap)); 2656 return SkNEW_ARGS(SkCanvas, (bitmap));
2651 } 2657 }
OLDNEW
« no previous file with comments | « include/gpu/GrRenderTarget.h ('k') | src/gpu/GrContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698