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

Side by Side Diff: src/gpu/gl/GrGpuGL.cpp

Issue 105353002: Do not use GrBicubic effect when downscaling. Also, don't use glTexStorage as it interferes with de… (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: address comments Created 7 years 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/gpu/SkGpuDevice.cpp ('k') | tests/MatrixTest.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 8
9 #include "GrGpuGL.h" 9 #include "GrGpuGL.h"
10 #include "GrGLStencilBuffer.h" 10 #include "GrGLStencilBuffer.h"
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after
545 if (!adjust_pixel_ops_params(desc.fWidth, desc.fHeight, bpp, &left, &top, 545 if (!adjust_pixel_ops_params(desc.fWidth, desc.fHeight, bpp, &left, &top,
546 &width, &height, &data, &rowBytes)) { 546 &width, &height, &data, &rowBytes)) {
547 return false; 547 return false;
548 } 548 }
549 size_t trimRowBytes = width * bpp; 549 size_t trimRowBytes = width * bpp;
550 550
551 // in case we need a temporary, trimmed copy of the src pixels 551 // in case we need a temporary, trimmed copy of the src pixels
552 SkAutoSMalloc<128 * 128> tempStorage; 552 SkAutoSMalloc<128 * 128> tempStorage;
553 553
554 // paletted textures cannot be partially updated 554 // paletted textures cannot be partially updated
555 bool useTexStorage = isNewTexture && 555 // We currently lazily create MIPMAPs when the we see a draw with
556 // GrTextureParams::kMipMap_FilterMode. Using texture storage requires that the
557 // MIP levels are all created when the texture is created. So for now we don 't use
558 // texture storage.
559 bool useTexStorage = false &&
560 isNewTexture &&
556 desc.fConfig != kIndex_8_GrPixelConfig && 561 desc.fConfig != kIndex_8_GrPixelConfig &&
557 this->glCaps().texStorageSupport(); 562 this->glCaps().texStorageSupport();
558 563
559 if (useTexStorage && kDesktop_GrGLBinding == this->glBinding()) { 564 if (useTexStorage && kDesktop_GrGLBinding == this->glBinding()) {
560 // 565 is not a sized internal format on desktop GL. So on desktop with 565 // 565 is not a sized internal format on desktop GL. So on desktop with
561 // 565 we always use an unsized internal format to let the system pick 566 // 565 we always use an unsized internal format to let the system pick
562 // the best sized format to convert the 565 data to. Since TexStorage 567 // the best sized format to convert the 565 data to. Since TexStorage
563 // only allows sized internal formats we will instead use TexImage2D. 568 // only allows sized internal formats we will instead use TexImage2D.
564 useTexStorage = desc.fConfig != kRGB_565_GrPixelConfig; 569 useTexStorage = desc.fConfig != kRGB_565_GrPixelConfig;
565 } 570 }
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
631 GL_CALL(PixelStorei(GR_GL_UNPACK_FLIP_Y, GR_GL_TRUE)); 636 GL_CALL(PixelStorei(GR_GL_UNPACK_FLIP_Y, GR_GL_TRUE));
632 } 637 }
633 GL_CALL(PixelStorei(GR_GL_UNPACK_ALIGNMENT, static_cast<GrGLint>(bpp))); 638 GL_CALL(PixelStorei(GR_GL_UNPACK_ALIGNMENT, static_cast<GrGLint>(bpp)));
634 } 639 }
635 bool succeeded = true; 640 bool succeeded = true;
636 if (isNewTexture && 641 if (isNewTexture &&
637 0 == left && 0 == top && 642 0 == left && 0 == top &&
638 desc.fWidth == width && desc.fHeight == height) { 643 desc.fWidth == width && desc.fHeight == height) {
639 CLEAR_ERROR_BEFORE_ALLOC(this->glInterface()); 644 CLEAR_ERROR_BEFORE_ALLOC(this->glInterface());
640 if (useTexStorage) { 645 if (useTexStorage) {
641 // We never resize or change formats of textures. We don't use 646 // We never resize or change formats of textures.
642 // mipmaps currently.
643 GL_ALLOC_CALL(this->glInterface(), 647 GL_ALLOC_CALL(this->glInterface(),
644 TexStorage2D(GR_GL_TEXTURE_2D, 648 TexStorage2D(GR_GL_TEXTURE_2D,
645 1, // levels 649 1, // levels
646 internalFormat, 650 internalFormat,
647 desc.fWidth, desc.fHeight)); 651 desc.fWidth, desc.fHeight));
648 } else { 652 } else {
649 if (GR_GL_PALETTE8_RGBA8 == internalFormat) { 653 if (GR_GL_PALETTE8_RGBA8 == internalFormat) {
650 GrGLsizei imageSize = desc.fWidth * desc.fHeight + 654 GrGLsizei imageSize = desc.fWidth * desc.fHeight +
651 kGrColorTableSize; 655 kGrColorTableSize;
652 GL_ALLOC_CALL(this->glInterface(), 656 GL_ALLOC_CALL(this->glInterface(),
(...skipping 2036 matching lines...) Expand 10 before | Expand all | Expand 10 after
2689 this->setVertexArrayID(gpu, 0); 2693 this->setVertexArrayID(gpu, 0);
2690 } 2694 }
2691 int attrCount = gpu->glCaps().maxVertexAttributes(); 2695 int attrCount = gpu->glCaps().maxVertexAttributes();
2692 if (fDefaultVertexArrayAttribState.count() != attrCount) { 2696 if (fDefaultVertexArrayAttribState.count() != attrCount) {
2693 fDefaultVertexArrayAttribState.resize(attrCount); 2697 fDefaultVertexArrayAttribState.resize(attrCount);
2694 } 2698 }
2695 attribState = &fDefaultVertexArrayAttribState; 2699 attribState = &fDefaultVertexArrayAttribState;
2696 } 2700 }
2697 return attribState; 2701 return attribState;
2698 } 2702 }
OLDNEW
« no previous file with comments | « src/gpu/SkGpuDevice.cpp ('k') | tests/MatrixTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698